john@perl:~$ perl -e' my $lines = qq[one two three four ]; open F, "<", \$lines or die "open: $!"; while ( ) { last if /h/; } print $_; ' three