in reply to Dealing with nextline of a file

Instead of looking at the next line, consider looking at the last line and the current line:

my $lastline; while (my $currentline = <$fh>) { chomp $currentline; my @tmp = split /\s+/, $row; ... $lastline = $currentline; }

Alternatively, you can look at accessing the file as an array, using Tie::File.

If you're dealing with CSV data, consider using Text::CSV_XS.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.