#!perl -w use strict; use HTML::Parser; my $html = <<'END_HTML';
Username:
Password:
END_HTML my $parser = HTML::Parser->new( start_h => [ \&_parser_starttag, 'tagname, attr' ] ); $parser->parse( $html ); sub _parser_starttag { my ($tag, $attr) = @_; if ( exists $attr->{'onchange'} ) { warn( "<$tag> - onChange: ", $attr->{'onchange'}, "\n" ); } elsif ( exists $attr->{'onclick'} ) { warn( "<$tag> - onClick: ", $attr->{'onclick'}, "\n" ); } }