Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Best way to replace 'die' with 'warn' (no __DIE__)

by tye (Sage)
on Dec 06, 2009 at 06:39 UTC ( #811308=note: print w/replies, xml ) Need Help??


in reply to Best way to replace 'die' with 'warn'

Better:

sub whether_subroutine() { my @results; if( ! eval { @results= weather_subroutine(@_); 1 } ) { warn $@; return; } return @results; }

- tye        

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2020-10-19 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (205 votes). Check out past polls.

    Notices?