Will Perl's $@ ever be undefined after an eval? -
i'm working on "error handling , reporting" chapter of mastering perl. in perlvar's entry $@
, says:
perl syntax error message last eval() operator. if $@ null string, last eval() parsed , executed correctly (although operations invoked may have failed in normal fashion).
now i'm wondering when eval might not execute correctly, leaving $@
undefined value. there such cases?
here's 1 way (but sit down before read it. ;))
$@ = 123; eval q{ $@ = 456; print ">>>$@<<<\n"; goto skip; }; skip: print ">>>$@<<<\n";
Comments
Post a Comment