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

In reply to Re: WWW::Mechanize:field not submitted by ikegami
in thread WWW::Mechanize:field not submitted by Yappo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.