http://www.perlmonks.org?node_id=439717


in reply to Foreach Loops

Well, if you really need just the previous element you can go with
my $lline; foreach my $line (@arr) { ## stuff goes here; $lline = $line; }


holli, /regexed monk/