Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: for ($@)

by edoc (Chaplain)
on Jan 19, 2005 at 00:48 UTC ( [id://423231]=note: print w/replies, xml ) Need Help??


in reply to for ($@)

FWIW..

This looks to me like a first revision which was intended to be developed further. As mentioned by hardburn the for ($@) sets $_ to the value of $@. Why would we want to do that? So we could then do something like:

eval { # bla bla }; for ($@) { /NOT FOUND/ && do { print 'Where'd I put that?'; last; }; print 'Na,ah. Not for you!' if /FORBIDDEN/; }

Each of those is testing the string value of $@

cheers,

J

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-25 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found