Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-10-30 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls