use strict; use File::Find; my %seen; sub wanted { if ( /\.html$/) { open F, "< $File::Find:name" or die "read $File::Find::name: $!\n"; local $_; while () { if ( /(.*?)<\/title>/si ) { print "Title = $1\n" unless $seen{$1}++; } } close F; } } find( \&wanted, "/unixpath/webfiles" );