use v5.12; use warnings; use Data::Dump qw/pp dd/; say pp $/; # show default say my $x = "HEADER\n" x 3 . "fieldname: BLA BLA\n" . join $/, 1..5; open my $fh, '<', \$x; # ignore anything prior to "fieldname" { local $/ = "fieldname:"; <$fh> }; say pp $/; # back to default say "-" x 10; say "fieldname:" . <$fh>; # till end of line
"\n" HEADER HEADER HEADER fieldname: BLA BLA 1 2 3 4 5 "\n" ---------- fieldname: BLA BLA
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^3: skip junk lines in csv before header
by LanX
in thread skip junk lines in csv before header
by karlberry
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |