my @files = glob "*dly"; foreach my $file (@files) { open (IN, $file); while (<IN>) { if (/^.{69}000/) { print "$file: $_"; } } close IN; }
Jay, please start usin' the lexical handles! So you can say open( my $IN, $file ) or die "Can't open $file: $!\n"; Using the old-style handles is dangerous. You can also shorten it reaaaally short like so: $ perl -lne'print "$ARGV: $_" if /^.{69}000/' *dlyThat "open the file, read it and loop over it" is very common, and command line flags make it even easier.
-- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance