2024-06-21

This commit is contained in:
2024-06-21 14:57:07 +09:00
parent 04caa2eb53
commit e00dd1bfbf
43 changed files with 2689 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# 오류 처리
- die
메시지를 출력하고 프로세스가 종료됩니다.
- warn
die와 마찬가지로 메시지를 출력하지만, 종료되지는 않습니다.
특수 변수인 `$!`에는 실제 오류 메시지가 들어있습니다.
```perl
if (...){
} else {
die "Error: xxx - $!";
}
```
```perl
open(...) or die "Error: xxx - $!";
```
```perl
warn "xxxx" unless (...);
```