Just another Perl shrine | |
PerlMonks |
Re^3: Word frequency in an arrayby blazar (Canon) |
on Jun 11, 2007 at 17:06 UTC ( [id://620538]=note: print w/replies, xml ) | Need Help?? |
Why not start with $x = 0, and then pre-increment instead of post-incrementing $x? In other words, ++$x, instead of $x++. Indeed. In fact it's also worth reminding incidentally that {pre,post}-{increment,decrement} behave intelligently by first of all not complaining under warnings and, in the case of post-ones, to "coerce to numeric value", that is, to return 0:
In Section
Seekers of Perl Wisdom
|
|