2025-02-10T05:29:29

This commit is contained in:
2025-02-10 05:29:29 +09:00
parent e00dd1bfbf
commit 6f1a75f466
45 changed files with 69 additions and 145 deletions

28
docs/16_error_handling.md Normal file
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 (...);
```