この構成はperlではかなり一般的です:
opendir (B,"/somedir") or die "couldn't open dir!";
しかし、これは機能していないようです。
opendir ( B, "/does-not-exist " ) or {
print "sorry, that directory doesn't exist.\n";
print "now I eat fugu.\n";
exit 1;
};
「または」エラー処理で複数のコマンドを使用することは可能ですか?
上記のコンパイル:
# perl -c test.pl
syntax error at test.pl line 5, near "print"
syntax error at test.pl line 7, near "}"
test.pl had compilation errors.