#!/usr/bin/perl -w

use strict;
use WWW::Mechanize;
use HTML::TokeParser::Simple;
use LWP::Simple;

my $mech = WWW::Mechanize->new();
my $htp = get($url);
my $name = {};
my @names;

$mech->get ('http://linuxgazette.net/mailman/admindb/tag');
# insert password here.
$mech->submit_form(form_number => 1,
               fields      => {adminpw => ''});

# Steps to get to the next page need to be inserted here.
# Use the follow_link or submit_form methods to get to the target page

# once we have the page you sent me.
my $p = HTML::TokeParser::Simple->new(\$mech->content) || die "Can't open page: $!";

while (my $token = $p->get_tag('input'))
{
    next unless $token->return_attr('type') =~ /radio/i;
    if ($token->return_attr('name') =~ /^(senderaction-.*)/)
        {
        $name->{'name'} = $1;
        $name->{'value'} = 3;
        push @names, $name;
    }
}

$mech->submit_form(form_number => 1, fields => \@names);
#print $mech->response();
#print $mech->content();
