[Wellington-pm] A question about scopes
Grant McLean
grant at mclean.net.nz
Tue Mar 28 14:02:38 PST 2006
On Tue, 2006-03-28 at 21:56 +1100, Jacinta Richardson wrote:
> In a case for me today, I wanted WWW::Mechanize to let me "tick" every checkbox
> of a given name. The standard API didn't work in the way I needed, so I
> Data::Dumped the object, played around with a few ideas and found a cheaty way
> of doing it. Personally I think either the documentation is wrong, or it's a
> bug that I couldn't do it the only obvious way, but regardless that didn't solve
> the problem *now*.
I had to do something similar but got away with sticking to published
APIs like this:
my($form) = $mech->forms;
foreach my $input ($form->inputs) {
my $name = $input->name || next;
next unless $input->type eq 'checkbox';
next unless $name =~ /some_pattern/;
$input->check;
}
$mech->submit;
Was your requirement more esoteric?
Cheers
Grant
More information about the Wellington-pm
mailing list