## create an HTML::TreeBuilder obj from the content my $tree = $self->gen_tree( $mech->content() ); ## see if there are exactly 10 camel_id checkboxes $self->check_for_input( $tree, sub { my ($widget) = @_; if (lc( $widget->attr('type') ) eq 'checkbox' and $widget->attr('name') eq 'camel_id') { return 1; } return; }, 'Camel checkboxes', 10);