Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by tye (Sage)
on Dec 06, 2009 at 06:39 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://811308]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-26 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found