in reply to Scanning web pages for accessibility

Using the modules HTML::Treebuilder and HTML::Element should make this job rather easy. Here's a quick script that would probably do the job.
use HTML::Element;
use HTML::TreeBuilder;
  
my $root = HTML::TreeBuilder->new;
$root->parse_file('foo.html'); # source file
  
foreach my $img ($root->find_by_tag_name('img')) {
    my $alt = $img->attr('alt');
    
    if(!$alt) {
       my $bad_img = $img->attr('src');
       print "There is no alt tag for the image $bad_img\n";
    }
}
For more info, I would highly suggest reading Sean M. Burke's articles in The Perl Journal #18 and #19 located in the archives at tpj.com.
  • Comment on Re: Scanning web pages for accessibility