my $cnt; for my $element (@elements) { unless ($cnt++) { # deal w/first element next; } # Deal w/the rest }
In reply to Re: Determine first element in foreach
by runrig
in thread Determine first element in foreach
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |