Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: First JAPH - Spell perl in two hundred and eighty five thousand and seventy four easy steps

by blakem (Monsignor)
on Jan 12, 2002 at 13:26 UTC ( #138247=note: print w/ replies, xml ) Need Help??


in reply to Re: First JAPH - Spell perl in two hundred and eighty five thousand and seventy four easy steps
in thread First JAPH - Spell perl in two hundred and eighty five thousand and seventy four easy steps

From perlop:

    The auto-increment operator has a little extra builtin magic to it. If you increment a variable that is numeric, or that has ever been used in a numeric context, you get a normal increment. If, however, the variable has been used in only string contexts since it was set, and has a value that is not the empty string and matches the pattern /^[a-zA-Z]*[0-9]*$/, the increment is done as a string, preserving each character within its range, with carry:

      print ++($foo = '99'); # prints '100'
      print ++($foo = 'a0'); # prints 'a1'
      print ++($foo = 'Az'); # prints 'Ba'
      print ++($foo = 'zz'); # prints 'aaa'

    The auto-decrement operator is not magical.

-Blake


Comment on Re: Re: First JAPH - Spell perl in two hundred and eighty five thousand and seventy four easy steps

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2015-07-04 07:40 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 (58 votes), past polls