#!perl use strict; use warnings; use Test::More tests => 3; use HTML::DisableForm; my $df = HTML::DisableForm->new; my $html = < foobar

abcdefg

EOF my $output = $df->disable_form( scalarref => \$html, ignore_fields => [qw/foo bar/], ); 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') { if ($attr->{disabled}) { $p->{disabled_count}++ ; is $attr->{name}, 'baz'; } } } is $p->{disabled_count}, 1;