in reply to Post with parameters using hash

Remove the 'Content =>' portion. See perldoc lwpcook and the second example in the POST section.

In the future, it would be helpful to see the exact error message you've received.

Update: Since we can't tell what's in %hiddenhash, the best I can do is to speculate that there's an extra value in there that the server doesn't like. You might use the debugger or Data::Dumper to print the hash to verify that it contains exactly and only what you think it should contain:

use Data::Dumper; print STDERR Dumper(\%hiddenhash);

Replies are listed 'Best First'.
Re: Re: Post with parameters using hash
by Anonymous Monk on Mar 05, 2001 at 22:37 UTC
    Sorry the error is that the server is rejecting it, saying it's an invalid input.

    This code works
    $request = POST "http://www.server.com", Content => [ $formname1 => +'formvalue1', $formname2 => 'formvalue2' ];
    While this one causes the server to redirect to an error page. However, I have to do it this way, because I need to build the form parameters using a for loop.
    $hiddenhash{$formname1} = 'formvalue1'; $hiddenhash{$formname2} = 'formvalue2'; $request = POST "http://www.server.com", Content => [ %hiddenhash ];
      Funny I am having the same exact situation today, can't use a hash for the parameters.
      Tried a bunch of different ways.
      This code:
      $request = POST "http://www.server.com", Content => [ %hiddenhash ];
      simply doesn't work for me (or for the anonymous poster) Strange.. there is nothing in the hash that should be acting weird, no odd chars....does it need to be escaped or something?