in reply to search match within flat text file

i'm assuming memory's not a problem here, since i've never seen html files larger than a few hundred kilobytes. this will slurp the file into a scalar, and match against the scalar. i have a feeling this is faster than matching against every line. i don't know if this will meet all your requirements, because i'm not sure what "then continue..." means.

#!/usr/bin/perl -w use strict; my $tmp = "/path/to/my.html"; my $pattern = qr/File Error/i; my $html; { local *INFILE; open( INFILE, $tmp ) or die "ack! $!"; -f INFILE && sysread( INFILE, $html, -s INFILE ); } die "$tmp: $pattern not found" unless $html =~ $pattern; # then continue...

~Particle *accelerates*