http://qs321.pair.com?node_id=181890


in reply to (tye)Re: GOTO considered (a necessary) evil?
in thread GOTO considered (a necessary) evil?

there are cases where $@ can give the wrong impression about whether the eval was successful.

Can you give an example of that?
  • Comment on Re: (tye)Re: GOTO considered (a necessary) evil?

Replies are listed 'Best First'.
Re: example: eval fails but $@ ends up empty (was: GOTO...)
by tye (Sage) on Jul 15, 2002 at 22:17 UTC

    Sure:

    sub DESTROY { eval "1" } eval 'my $x = bless {}; die "ouch\n"'; print "($@)\n";
    which prints "()" not "(ouch\n)".

            - tye (but my friends call me "Tye")