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

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -