Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: capture errors from eval

by ikegami (Pope)
on Sep 24, 2012 at 01:13 UTC ( #995278=note: print w/ replies, xml ) Need Help??


in reply to capture errors from eval

for example, expression= '/HOST=.*(' will yield a fatal die error..

Not so.

use strict; use warnings; my $w = '$expdata =~ /HOST=.*(;'; eval $w;

eval catches fatals errors and places the message in $@.


Comment on Re: capture errors from eval
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (17)
As of 2015-07-29 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls