Mr. Shawn H. Corey wrote:
On Sat, 2006-15-04 at 22:30 +0100, Matt Richards wrote:
hello everybody, :) i'm just starting with perl and i have come across a little problem that i cant seem to solve, atm i have this code ...

my $response = $ua->request(POST $url,
Content_Type => 'form-data',
Content => my %fq_hash);

i would like the hash values in $fq_hash to be submitted as a form reply using post but for some reason the script the the values are posted to never seems to recive them :( .. i know the %fq_hash hash has the right data in because i tried a
print %fq_hash;
and it returned what i expected

if anybody could help me out that would be wonderful,
and if you can explain why this isn't working it would help me to learn about perl :)

Cheers,

Matty.



This is just a WAG but should it be:

my %fq_hash = ();
my $response = $ua->request( POST $url,
  Content_Type => 'form-data',
  Content      => \%fq_hash,
);

This would sent a reference to %fq_hash to the method, which should
populate it.


hello, i tried the code you gave me and the file that the data was being posted to didn't seem to get the data ...

but then i went back to a commented line that i had lying around from what i was tring before which was this ...

my $response = $ua->post( $url, %fq_hash );
and added in the \ to make this ..
my $response = $ua->post( $url, \%fq_hash );

and now it works fine :) hehe yay,

like hours and hours of messing about and all i was missing is a \ ....!

Cheers for you help.

Matty.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to