Short piece of code I wrote just to play with HTML::TokeParser. Run it against HTML files to see all the IMG tags that you've carelessly forgotten to add HEIGHT or WIDTH attributes to...
#!/usr/bin/perl -w use strict; use HTML::TokeParser; for my $file (@ARGV) { my $p = HTML::TokeParser->new($file) or next; while (my $token = $p->get_tag("img")) { print "$file:", $token->[1]{src}, "\n" unless defined ($token->[1]{height} && $token->[1]{width}); } }

Tony

Replies are listed 'Best First'.
Re: HTML pages with IMG tags with no HEIGHT or WIDTH
by merlyn (Sage) on Jan 01, 2001 at 02:09 UTC
Re: HTML pages with IMG tags with no HEIGHT or WIDTH
by OeufMayo (Curate) on Jan 10, 2001 at 14:08 UTC

    Along with the width and height, the alt tag should also be mandatory...

    unless defined ($token->[1]{height} && $token->[1]{width} && $token->[1]{alt} );
    <kbd>--
    PerlMonger::Paris(http => 'paris.pm.org');</kbd>