Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^3: the try/catch example from "Programming Perl" analyzed

by hardburn (Abbot)
on Aug 18, 2004 at 18:11 UTC ( #384062=note: print w/ replies, xml ) Need Help??

in reply to Re^2: the try/catch example from "Programming Perl" analyzed
in thread the try/catch example from "Programming Perl" analyzed

Well, that helps a bit with the implementation, but doesn't solve the fundamental problem of having to handle the non-blessed case. Also, you now have to pull in another module to check for blessedness.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Comment on Re^3: the try/catch example from "Programming Perl" analyzed
Replies are listed 'Best First'.
Re^4: the try/catch example from "Programming Perl" analyzed
by rsteinke (Scribe) on Aug 19, 2004 at 06:15 UTC

    You could always use some sort of object wrapper to convert the strings into error objects, and hide that in the 'try' code,

    local $_ = (blessed $@) ? $@ : MyStringErrorClass->new($@);
    or some such. That class (or a function that returns different error objects depending on the error string, or something), would know all about the Errno module, and other standard kinds of errors.

    Ron Steinke

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2015-11-27 16:04 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls