Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: Playing with non-localized $_ in nested loops.

by ysth (Canon)
on Aug 23, 2004 at 05:23 UTC ( [id://385011]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Playing with non-localized $_ in nested loops.
in thread Playing with non-localized $_ in nested loops.

There are actually two pieces of dwimmery going on; first, if a readline or a glob is the only thing in a while condition (whether a statement modifier or while statement), it gets an implicit $_ =. Next, if a while condition is a scalar assignment from a readline, readdir, glob, or each, the whole condition gets an implicit defined() wrapped around it, so the loop continues on "0" or "".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-29 13:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found