in reply to Edit complex file
UPDATE: @fields contains the last line after finishing the while loop.my @fields; my $i = 0; while ( my $line = <$FILE> ) { chomp $line; if ( $line =~ /\t/ ) { if ($i > 0 ) { # do smth with last @fields array } @fields = split "\t", $line; $i++; } else { push @fields, $line; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Edit complex file
by Anonymous Monk on May 03, 2006 at 14:36 UTC |