If I am understanding you correctly that is -
1. Copy the html content into a variable
2. Do regex substitution to change your form action inside that variable
3. Update the mechanize object with that variable
For example -
$content = $mech->save_content();
$content =~ s/(form.+?action=").+?(")/$1<YOUR DESIRED ACTION>$2/i;
$mech->update_html($content);
Hope that helps!