|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re^3: Editing Listed Data (index, stack)by Anonymous Monk |
| on Mar 25, 2013 at 01:03 UTC ( [id://1025211]=note: print w/replies, xml ) | Need Help?? |
|
How Do I iterate through the array, yet compare the next item against the former? You use an index, or you keep a stack The index approach, its missing boundary checking ( ; beware of off-by-one errors
The stack approach
Oh, but you $lastitem is not an array, right
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||