http://www.perlmonks.org?node_id=206243


in reply to A new question from the front line

If you know 'energy' wont occur on successive lines, how about:
perl -pe'$_=/\benergy\b/&&<>'

-Blake

Replies are listed 'Best First'.
Re^2: A new question from the front line
by Aristotle (Chancellor) on Oct 18, 2002 at 13:57 UTC
    His own code doesn't fulfill the successive lines criterion either. Golf time: perl -pe'$_=/energy/?<>:""' Hmm, yours beats me if you take out the \b though.

    Makeshifts last the longest.