Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Range operator weirdness?

by Ido (Hermit)
on Feb 28, 2002 at 15:38 UTC ( #148244=note: print w/ replies, xml ) Need Help??


in reply to Range operator weirdness?

The range operator (in list context) makes use of the magical auto-increment algorithm if the operands are strings. So the one character '1' is increased in its range. form perlop about Auto-Increment's magic: ...the increment is done as a string, preserving each character within its range...


Comment on Re: Range operator weirdness?
Re: Re: Range operator weirdness?
by PrakashK (Pilgrim) on Feb 28, 2002 at 15:51 UTC
    >> perl -le '$x = "1"; print ++$x for (1..9)' 2 3 4 5 6 7 8 9 10
    The autoincrement of "9" results in "10", not "0".

    /prakash

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2015-07-07 09:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls