in reply to Finding data
I haven't tested this code, but hope that it will work.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 = <HTML>; # slurp whole file close (HTML); my ($title) = m|<TITLE>(.*?)</TITLE>|is; # do with $title whatever you want... } # else } # if .html? } # wanted ...
/<TITLE>\w+</TITLE>/ will give a syntax error, because of / as separat +or and </T not escaped<BR> and \w+ will never match a space...
Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"
|
|---|