Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: Error Handling Misconception

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.