The best suggestion I can give, if you want to play it real safe and don't want work on copies (in which case a while loop would have been more obvious):
{ my $i = 1; foreach (@data) { print "$_"; print "\t" unless $i == @data; } continue { $i++; } }
The Sidhekin
print "Just another Perl ${\(trickster and hacker)},"
In reply to Re: looping idiom
by Sidhekin
in thread looping idiom
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |