Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Join lines that match an string

by linuxer (Curate)
on Jul 13, 2010 at 17:21 UTC ( #849324=note: print w/replies, xml ) Need Help??


in reply to Re^2: Join lines that match an string
in thread Join lines that match an string

But I still have the feeling I didn't get the whole idea correctly; especially when I see ambrus' solution.

If you want to keep the linebreak in the "p_agrs" line, then tell perl not to chomp it.

Example:

perl -wpe 'if ( m/\bremotely\b/ ... m/\bp_agrs\b/ ) { chomp unless m/\bp_agrs\b/ }'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://849324]
help
Chatterbox?
[LanX]: Sandy Koufax is indeed rude. .. oO
[chacham]: Re: Re: pattern matching -- feeling stoopit a poll idea about centrists, is +8 -5, used to be +6/-6 how apropos :)is +8
[chacham]: ...errr... Re: poll ideas quest 2015 (political centrist)
[chacham]: ooh, late, nighty nite everybody
[jdporter]: thanks, 1nickt1

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2017-05-24 21:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?