Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: flipflop .. operator. More about $. var

by pbeckingham (Parson)
on Aug 17, 2004 at 14:01 UTC ( [id://383667]=note: print w/replies, xml ) Need Help??


in reply to Re^4: flipflop .. operator. More about $. var
in thread State information for flipflop .. operator.

What I meant was that the result of the .. terms are compared to $. if the terms are numeric. For example:

while (<>) { if (1 .. 10) { } }
Will print lines 1 through 10 of the input, by using $. to compare to, which is 1-based.

$. doesn't go anywhere if you are not using <>, it just doesn't get reset and incremented. Furthermore, incrementing it yourself is probably not a good idea. Who knows what other (called) code might use it.



pbeckingham - typist, perishable vertebrate.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-24 17:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found