KEVIN ZEMBOWER wrote:
> John, thank you so much for both your suggestions. Even though Manav's 
> suggestions
> work, I learned a little more perl looking up the parts I didn't understand 
> in your
> suggestions. With just a slight modification, both of these worked:
> 
> perl -l -0777ne'print /L:(.+)\s/, q/@/, /H:(.+)\s/' `find -name config`
> perl -l -0777ne'$_ = join q/@/, /L:(.+)\s/, /H:(.+)\s/ and print'  `find 
> -name config`
> 
> I had to remove the ^ anchor, because, when treating the whole file as a 
> string
> (-l -0777), 'L:' and 'H:' are no longer at the beginning of the string.

Sorry about that, I didn't test it enough.  :-)

You can use the ^ anchor if if you also use the /m option

perl -l -0777ne'$_ = join q/@/, /^L:(.+)/m, /^H:(.+)/m and print' \
 `find -name config`



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to