while ( $line = ) { if ( $line =~ m/blah/ ){ print "here\n"; } }