Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Re: Error Handling Misconception

by bobn (Chaplain)
on Sep 03, 2003 at 23:10 UTC ( [id://288763]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Error Handling Misconception
in thread Error Handling Misconception

works for me:

my $object = new wierd; my $value = eval { $object->next_value() }; if ($@) { print "BLAH!\n$@\BLAH!\n"; } print $value, "\n"; package wierd; sub new { bless {}, shift} sub next_value { die "badness"; }
Produces:
BLAH! badness at ./tstprog.pl line 13. BLAH!

Are you sure you're in a situation where you can see what's printed? What happens when the routine works and $value is something printable?

--Bob Niederman, http://bob-n.com

All code given here is UNTESTED unless otherwise stated.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-03-29 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found