The final key here was that the second argument to the post method needed to be an array ref (i.e., the hash arguments needed to be enclosed in []s). The code below works, returning the desired output page in the $mech object.

#!/usr/bin/perl use warnings; use strict; use WWW::Mechanize; my $hypermutUrl = "http://http://hiv-dev.lanl.gov/cgi-bin/HYPERMUT/hypermut.cgi"; my $mech = WWW::Mechanize->new( autocheck => 1 ); my $alignment_as_string = <<'END_SEQS'; >HIV1-test.CONS ATGGGATGTCTTGGGAATCAGCTGCTTATCGCGCTCTTGCTAGTAAGTGCTTTAGAGATTTATTGTGTTC >HIV1-test.1 ATGGAATGTCTTGGAAATCAGCTGCTTATCGCGCTCTTGCTAGTAAGTGCTTTAAAGATTTATTGTGTTC >HIV1-test.2 ATGGAATGTCTTGGGAATCAGCTGCTTATCGCGCTCTTGCTAGTAAGTGCTTTAAAGATTTATTGTGTTC END_SEQS $mech->post( $hypermutUrl, [ 'FORMAT' => 'FASTA', 'ALIGNMENT' => $alignment_as_string, 'upfile1' => '', 'INN' => '', 'OUT' => '', 'MUTUPSTREAM' => '', 'MUTFROM' => 'G', 'MUTTO' => 'A', 'MUTDOWNSTREAM' => 'RD', 'ENFORCE' => 'DESCENDANT', 'CONTROLUPSTREAM' => '', 'CONTROLFROM' => 'G', 'CONTROLTO' => 'A', 'CONTROLDOWNSTREAM' => 'YN|RC', 'Analysis' => 'All', 'submit' => 'Run', ] ); my $page = $mech->content; open my $FH, ">/tmp/hypermut.html"; print {$FH} $page; close $FH; warn "saved webpage data to /tmp/hypermut.html\n";

Thanks to any and all who thought about it, and most particularly to my colleague who found my error.


In reply to Re^6: www::mechanize: second "submit" invisible to find_all_submits by wfischer
in thread www::mechanize: second "submit" invisible to find_all_submits by wfischer

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.