Do you know where your variables are? | |
PerlMonks |
Re: trim header lines in filesby rjt (Curate) |
on Aug 05, 2013 at 13:07 UTC ( [id://1047907]=note: print w/replies, xml ) | Need Help?? |
You can just chop off the pipe and anything thereafter before you print:
If the non-matching lines are quite long but the "or1" tags are short, it will speed things up to specify a quantifier on the substitution (Edit: disregard this optimization if non-matching lines never start with '>'): s/^>.{1,10}\K\|.*$//; # Tag is between 1..10 chars
use strict; use warnings; omitted for brevity.
In Section
Seekers of Perl Wisdom
|
|