in reply to Determine first element in foreach

my $cnt; for my $element (@elements) { unless ($cnt++) { # deal w/first element next; } # Deal w/the rest }