Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 imbibing at the Monastery: (15)
As of 2014-09-02 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (25 votes), past polls