sub wanted { if ( /\.html?$/ ){ # if .htm or .html local $/; # throw away stdin-separator unless( open (HTML, $File::Find::name) ){ warn "Error couldn't read $File::Find::name: $!\n"; } # unless else { my $line = ; # slurp whole file close (HTML); my ($title) = m|(.*?)|is; # do with $title whatever you want... } # else } # if .html? } # wanted ...