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

Re^5: Filling in missing values in an array

by FunkyMonk (Canon)
on Jun 30, 2011 at 10:07 UTC ( #912138=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Filling in missing values in an array
in thread Filling in missing values in an array

If you don't want the code to die, you need to use something to catch the exception. I like Try::Tiny:

use Try::Tiny; my @bad = try { fill_in_the_blanks(qw<_ _ _>) } # fails catch { print "bad data!\n" }; my @good = try { fill_in_the_blanks(qw<_ 1 _>) } # succeeds catch { print "bad data!\n" };


Comment on Re^5: Filling in missing values in an array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2014-08-02 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (54 votes), past polls