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


in reply to Break one liner command line script after first match

Hi

why not just exiting after printing the matched line?

UPDATE: perl -ne'/(data)/ && print($1) && exit' file.txt

McA