in reply to Searching text files with strings
To strip HTML coding and find if file matches substring you can use HTML::TokeParser. Untested code ($SUBSTR - required string)
require HTML::TokeParser; while $file (@files) { my $p = HTML::TokeParser->new(file); my $match = 0; while(my $token = $p->get_token) { next unless @$token[0] eq 'T'; if(index @$token[1], $SUBSTR) { $match = 1; last; } } if($match) { print $file, "\n"; } }
To get filenames without subdirectories or extensions use File::Basename.
|
|---|