Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: trim header lines in files

by choroba (Bishop)
on Aug 05, 2013 at 13:09 UTC ( #1047908=note: print w/replies, xml ) Need Help??


in reply to trim header lines in files

The pipe character is not whitespace. You can mention it in the regex, you even do not have to backslash it, because it appears in a character class:
while (<>) { if (/^(>[^|]*)/) { print "$1\n"; } else { print; } }
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047908]
help
Chatterbox?
[choroba]: The previous line tells it all.
[choroba]: "Out of memory!" - anything can happen afterwards
[Discipulus]: my father sometimes gives the same result.. good fellow

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2018-02-21 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (280 votes). Check out past polls.

    Notices?