in reply to WWW::Mechanize:field not submitted

What makes you think categories[some_tag] is not being submitted? I'd love to see the value returned by

$mech->response()->request()->as_string()

Update: Works for me:

use strict; use warnings; use URI::file qw( ); use WWW::Mechanize qw( ); my $mech = WWW::Mechanize->new(); $mech->get(URI::file->new_abs('file.html')); $mech->form_number(1); $mech->field("headline","MyHeadline"); $mech->field("thecontent","MyContent"); $mech->field("categories[some_tag]","Blah"); $mech->click("publish"); print $mech->response()->request()->as_string()
<form method="POST"> <input type="text" name="headline" /> <input type="text" name="thecontent" /> <input type="text" name="categories[some_tag]" /> <input type="submit" name="publish" /> </form>
POST file:///path/to/file.html Accept-Encoding: gzip Referer: file:///path/to/file.html User-Agent: WWW-Mechanize/1.34 Content-Length: 70 Content-Type: application/x-www-form-urlencoded headline=MyHeadline&thecontent=MyContent&categories%5Bsome_tag%5D=Blah
>perl -wle"use LWP; print LWP->VERSION" 5.825 >perl -wle"use WWW::Mechanize; print WWW::Mechanize->VERSION" 1.34

Replies are listed 'Best First'.
Re^2: WWW::Mechanize:field not submitted
by Yappo (Novice) on Mar 11, 2009 at 13:29 UTC
    Thank you for your help.
    Problem was much simpler:
    within the form (60K) there was a hidden field; using this as field name instead worked...
    Thanks again for your efforts.