Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: two statements in or

by poolpi (Hermit)
on Jun 26, 2009 at 12:59 UTC ( #775044=note: print w/ replies, xml ) Need Help??


in reply to two statements in or

See autodie

eval { use autodie; open( my $fh, '<', $my_file ); # ... close($fh); }; if ( $@ and $@->isa('autodie::exception') ) { if ( $@->matches('open') ) { print "Error from open\n"; # ... } } else { # open OK... }


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb


Comment on Re: two statements in or
Download Code
Re^2: two statements in or
by Anonymous Monk on Jun 26, 2009 at 15:09 UTC
    open ... or do{ .. }; open ... or ..., ...;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2014-12-21 21:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (108 votes), past polls