in reply to Line-by-line processing of a file where the first line is different
It is generally more reliable and controllable process than using <>. Reading the first line with smth like my $header = <$fh>; was already described in the above comments.foreach my $file (@ARGV) { open my $fh, $file or warn("Cannot open file $file: $!\n"), next; my $header = <$fh>; #process header while (<$fh>) { # process file } }
|
|---|