while () { chomp; if ( $_ eq "testpoint" ) { last; } } #### while (<>) { if ( /^testpoint\s*$/ ) { last; } }