in reply to Printing matched lines

I think your best bet would be to use Perl's match operator, but then again one of the other monks might have a better solution (I'm still learning!). I just setup a little test text file and wrote a few lines of code (below) and it does what you were asking for.
Text file --------------------------------------- 1234567 is alive 12345678 is not alive 123456789 is alive<br><br> Code --------------------------------------- #! /usr/bin/perl -w use strict; open(FILE, ">test.txt") || die "Unable to open file: $!"; chomp (my @input = <FILE>); # store lines in array, removing CRLF close(FILE); foreach my $line (@input) { if($line =~ m/is alive/) { print "$line\n"; } } Output ------------------------------------- 1234567 is alive 123456789 is alive
Hope this helps!! -Eric