in reply to skip junk lines in csv before header

This code as written consumes the entire input file:
Stop reading more lines from the file once you have found the header line.
my $header_line; while (<$fh>) { next unless /^fieldname/; # skip to header line $header_line = $_; last; ####### ADDD THIS ##### }

Replies are listed 'Best First'.
Re^2: skip junk lines in csv before header
by karlberry (Sexton) on Jul 24, 2022 at 17:48 UTC
    Thank you very much. I'm sorry for my stupidity in not seeing that!