Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: eval {require module};?

by nobull (Friar)
on Mar 17, 2006 at 17:27 UTC ( #537506=note: print w/replies, xml ) Need Help??


in reply to Re: eval {require module};?
in thread eval {require module};?

Many months later I now know how eval{} can fail and yet not set $@. It happens if a DESTROY method called during the stack-unwind also does an eval.
use AtExit; eval { my $q = AtExit->new(sub{eval{}}); die "Oops\n"; }; print $@; # Prints nothing

Replies are listed 'Best First'.
Re^3: eval {require module};?
by Anonymous Monk on Mar 17, 2006 at 20:17 UTC
    Which means you have to
    sub DESTROY{ local $@; eval{...} }
    if you want to use eval in DESTROY.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://537506]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2021-04-17 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?