#!perl use strict; use warnings; use Test::More tests => 8; use HTML::DisableForm; my $df = HTML::DisableForm->new; isa_ok $df, 'HTML::DisableForm'; can_ok $df, 'disable_form'; can_ok $df, 'readonly_form'; my $html = < foobar

abcdefg

EOF my $output = $df->disable_form(scalarref => \$html); ok $output; my $p = HTML::Parser->new(api_version => 3); $p->handler(start => \&handle_start, "self, tagname, attr"); $p->parse($output); sub handle_start { my ($p, $tagname, $attr) = @_; if ($tagname eq 'input' or $tagname eq 'textarea') { ok $attr->{disabled}; $p->{disabled_count}++; } } is $p->{disabled_count}, 3;