http://www.perlmonks.org?node_id=897141

hesco has asked for the wisdom of the Perl Monks concerning the following question:

sub www_mech_deactivate { my $self = shift; my $email = shift; my $uid = $self->get_uid_from_email($email); my $path = $self->{'cfg'}->param("paths.subscription_management_page +"); $path =~ s/UID/$uid/; $self->{'agent'}->get($path); # this works to subscribe person to all lists: $self->{'agent'}->submit_form( form_number => 2, fields => { 'newsletters[65]' => '65', 'newsletters[34]' => '34', 'newsletters[17]' => '17', 'newsletters[71]' => '71', } ); # But all of these attempts fail . . . $self->{'agent'}->untick('newsletters[17]'); $self->{'agent'}->untick('newsletters[65]',''); $self->{'agent'}->untick('newsletters[34]','checked'); $self->{'agent'}->untick('newsletters[71]','71'); $self->{'agent'}->submit_form( form_number => 2 ); return; }
UPDATE:

Thanks Wind, I just tried that, and still I get the following errors:

No checkbox "newsletters[17]" for value "17" in form at /home/hesco/li +b/CMS/Drupal/SimpleNews.pm line 70 No checkbox "newsletters[34]" for value "34" in form at /home/hesco/li +b/CMS/Drupal/SimpleNews.pm line 71 No checkbox "newsletters[71]" for value "71" in form at /home/hesco/li +b/CMS/Drupal/SimpleNews.pm line 72 No checkbox "newsletters[83]" for value "83" in form at /home/hesco/li +b/CMS/Drupal/SimpleNews.pm line 73
And to give some sense of the html I'm interacting with:

<div class="form-item form-option" id="edit-newsletters-34-wrapper"> <label class="option" for="edit-newsletters-34"><input type="check +box" name="newsletters[34]" id="edit-newsletters-34" value="34" chec +ked="checked" class="form-checkbox" /> Guests</label> </div>
Can anyone please offer some additional guidance, please?

-- Hugh

if( $lal && $lol ) { $life++; }
if( $insurance->rationing() ) { $people->die(); }