I would like to use CGI.pm to access the raw POST data sent to me from paypal and then send it back out using LWP. This code does it well.
Code:
# read post from PayPal system and add 'cmd'
read (STDIN, $query, $ENV{'CONTENT_LENGTH'});
$query .= '&cmd=_notify-validate';
# post back to PayPal system to validate
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$req = new HTTP::Request 'POST','http://www.paypal.com/cgi-bin/webscr';
$req->content_type('application/x-www-form-urlencoded');
$req->content($query);
$res = $ua->request($req);
However, I want to use the CGI module, any ideas? I have added it using the $q->param(-name,-value) function but I have no idea what I should be sending out through LWP, as it is a hash. I have tried sending the CGI object itself with no luck.