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 (Patriarch)
on Sep 24, 2012 at 01:13 UTC ( [id://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 $@.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-26 00:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found