http://www.perlmonks.org?node_id=93766


in reply to Auto-increment and Auto-decrement

The perlop man page states,
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...
It doesn't say the decrement works the same way. Too bad; one would think so without reading the docs carefully.

—John

update: see Magical Auto-Decrement.

Replies are listed 'Best First'.
Re: Re: Auto-increment and Auto-decrement
by kiseok7 (Beadle) on Jul 04, 2001 at 11:52 UTC
    very thanks!