use strict; use warnings qw( all ); while (<>) { if (/test/) { print "start\n"; last; } }