I'm trying to submit a form by post method using WWW::Mechanize
perl module.
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
...
$mech->get($url);
...
my $response = $mech->submit_form(
form_name => $name,
fields => {
$field_name => $field_value
},
button => 'Button'
);
$field_name
is generally speaking a text field (though the type is not specified explicitly in the form), which has a preset value.
$field_name => $field_value
in $mech->submit_form
on whatever reason does not replace the value, instead $field_value
is added into the form after the original value:
{submitted_field_value} = {original_value},{provided_value}
How to replace {original_value}
with {provided_value}
in the form to be submitted ?