open TEST,"@ARGV[0]"; $flag ="ON" while(){ if(/test/ and $flag eq "ON"){print "start";$flag ="OFF"}} close TEST