perl «или» обработка ошибок :multi -заявление об ошибке возможно?

Эта конструкция довольно распространена в 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.
7
задан raindog308 4 May 2012 в 18:16
поделиться