Although I find it a bit odd that widget is a hash. If perhaps widget is really an array, then the code you need is this:$webpage = $browser->post($form_url, [ username => $username, (map {widget => $widget{$_}} (keys %widget)), created => '1126175051' ],Content_Type => 'form-data'));
To debug this, I would strongly recommend doing something like this in your code:$webpage = $browser->post($form_url, [ username => $username, (map {widget => $_} @widget), created => '1126175051' ],Content_Type => 'form-data'));
Then you can test out variants of lwparg until you get one that's passing the right stuff.my $lwparg = [ username => $username, (map {widget => $widget{$_}} (keys %widget)), created => '1126175051' ]; use Data::Dumper; print Data::Dumper->Dump([$lwparg],['lwparg']); $webpage = $browser->post($form_url, $lwparg, Content_Type => 'form-da +ta'));
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/
In reply to Re: Using LWP's "post" to send n fields into a form?
by fizbin
in thread Using LWP's "post" to send n fields into a form?
by aboyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |