Perl Monk, Perl Meditation | |
PerlMonks |
Re: Help me to understand increment / decrement operator behavior in perlby vinoth.ree (Monsignor) |
on Mar 04, 2015 at 06:07 UTC ( [id://1118714]=note: print w/replies, xml ) | Need Help?? |
Hi,
I have tried your code with two different variables as below, Is works as expected.
Unary The auto-decrement (--), and auto-increment (++) operators are unary operators. They alter the scalar variable they operate on by one logical unit. On numbers, they add or subtract one.Operators that come in post- and pre- varieties can be used two ways. The first way returns the value of the variable before it was altered, and the second way returns the value of the variable after it was altered.
All is well. I learn by answering your questions...
In Section
Seekers of Perl Wisdom
|
|