![]() |
|
laziness, impatience, and hubris | |
PerlMonks |
Re: Applying a regular expression to a stringby ambs (Pilgrim) |
on Apr 04, 2005 at 11:42 UTC ( #444628=note: print w/replies, xml ) | Need Help?? |
If $a=+1 is not the same as $a=$a+1. This is just true in case $a is undef or zero. So, you might want to say $a+=1 is the same as $a=$a+1. In any case, $a=$a+1 changes $a, so that is not what you want.
Your second code snipet is correct. You can also use
Alberto Simões
In Section
Seekers of Perl Wisdom
|
|