in reply to Perl's feature to determine, in current point of loop, that this is the last one?

Do you mean something like this:

$ perl -le' my @array = "A" .. "H"; my $count = @array; for my $letter ( @array ) { if ( --$count ) { print "Letter: $letter"; } else { print "Last letter: $letter"; } } ' Letter: A Letter: B Letter: C Letter: D Letter: E Letter: F Letter: G Last letter: H
  • Comment on Re: Perl's feature to determine, in current point of loop, that this is the last one?
  • Download Code