use File::Find; sub fetcher { my($ct, @data) = (0,()); if( $_ =~ /\.html?$/) { my $name = $File::Find::name; open ( F, $name ) or die "$!: $name\n"; #while( $line = ) # { # for $i ($line =~ /stuffhere)/gi ) { # push(@data, "$i\n"); # gather the lines # $ct++; # } #} # since there is no requirement the lines need to match # why not local $/ = undef; @data = ; close F; } return($ct,\@data); } my ($ct, $data) = find( \&fetcher, "/directory" ); print @$data; print "\n\nTotal Count = $ct\n\n";