Subject: | the first example in the POD doesn't work |
The SYNOPSIS example in 1.22 doesn't work:
my $lint = HTML::Lint->new;
$lint->only_types( HTML::Lint::STRUCTURE );
$lint->parse( $data );
$lint->parse_file( $filename );
my $error_count = $lint->errors;
foreach my $error ( $lint->errors ) {
print $error->as_string, "\n";
}
HTML::Lint::STRUCTURE should be HTML::Lint::Error::STRUCTURE.
As it is, it dies under 'use strict', and appears to silently pass
under 'no strict'.
(Incidentally, since $error->type() returns a numeric, it would be
nice if the mapping of numbers to error type names was in the POD,
or else for a type_name() method to return 'STRUCTURE' etc.)