laziness, impatience, and hubris | |
PerlMonks |
Re^3: Infinity loopby nobull (Friar) |
on Nov 20, 2005 at 17:59 UTC ( [id://510262]=note: print w/replies, xml ) | Need Help?? |
Well you could avoid the temporary variable by using //g in a LIST context instead. I wouldn't recommend it if the temporary list was likely to be of non-trivial size.
If course if the body of your loop is really just ++$CG then all you are doing is counting the number of elements in the list. In that case the "pimply-goatse-operator" mentioned earlier in ths thread is what you want.
In Section
Seekers of Perl Wisdom
|
|