in reply to Why do Perlers hate C-style for-loops, especially when they're called for?
in thread 'each' syntax oddity?
Your code has many potential "off by one" locations. Yes, it's possible to get it exactly right, but much safer to let Perl deal with the edges than for me to keep computing the edges. Call it defensive programming.my @copy = @array; while (my ($first, $second) = splice @copy, 0, 2) { # do stuff }
-- Randal L. Schwartz, Perl hacker
|
|---|