On Jun 27, Nick Transier said:

>If I define a variable as a string
>my $var = "a";
>
>I can get the increment to work
>print ++$var; --> prints b
>
>but the decrement
>print --$var --> prints -1
>
>Why? and how can I decrement it?

The perlop documentation says that ++ is magical for strings, but that --
isn't.  The reason is because there's not a clear-cut way of defining it.

What is 'a'--? 

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **

Reply via email to