Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The output should print the name of the html file and the Title info like this:<TITLE>TITLE OF MY HTML PAGE</TITLE>
Here is my attempt at it and was hoping someone could help get this working correctly.mainpage.html TITLE OF MY HTML PAGE secondpage.html Another Title in an HTML Pa +ge
use File::Find; sub wanted { if( -f $_ = '*.htm* ) { open ( F, $_ ) or die; while( defined( $line = <F> ) ) { if( $line =~ /<TITLE>(\w+)</TITLE>/i) { print "FILE = $_ and TITLE = $1\n"; } elsif( $line =~ /<title>(.*$)<title>/i) { print "FILE = $_ and TITLE = $1\n"; } } close F; } } find( \&wanted, "." );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding data
by Chady (Priest) on Feb 28, 2002 at 17:46 UTC | |
|
Re: Finding data
by dragonchild (Archbishop) on Feb 28, 2002 at 17:46 UTC | |
by Anonymous Monk on Feb 28, 2002 at 18:52 UTC | |
|
Re: Finding data
by strat (Canon) on Feb 28, 2002 at 17:49 UTC |