Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: capture errors from eval

by tobyink (Abbot)
on Sep 23, 2012 at 21:05 UTC ( #995252=note: print w/ replies, xml ) Need Help??

in reply to capture errors from eval


eval { eval $w }
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: capture errors from eval
by sdetweil (Sexton) on Sep 23, 2012 at 21:30 UTC
    sorry, actually this does work!.. had two places and only tested on one (the wrong one obviously!).. thank you
Re^2: capture errors from eval
by sdetweil (Sexton) on Sep 23, 2012 at 21:19 UTC
    sorry, dumb answer.. only tested in one of two places.. this works great and $@ contains the error text..

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2016-06-30 08:13 GMT
Find Nodes?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...

    Results (389 votes). Check out past polls.