Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: for ($@)

by hardburn (Abbot)
on Jan 18, 2005 at 21:30 UTC ( [id://423190]=note: print w/replies, xml ) Need Help??


in reply to for ($@)

That particular use of for sets the $_ to whatever was in $@. The code as presented doesn't do anything useful with $_, so you can replace it with if($@). The for expression is normally a looping construct, but it isn't be used that way here.

The single quotes around $@ are also probably incorrect. You'll need double quotes so you can print out the value of $@. Or just leave them off entirely and Perl will do the Right Thing in this case.

"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.

Log In?
Username:
Password:

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

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

    No recent polls found