For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2005 > Question using LWP









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Question using LWP
Mike Blezien

2005-08-25, 9:55 pm

Hello,

I have a script that uses the LWP module to pass data to a remote script B, that
process the data sent from script A

the code in script A passes data from a standard form to script B($post_url):

# send to paypro script via the LWP.
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
$ua->agent("HTTP/1.1");
my $req = new HTTP::Request 'POST' => "$post_url";
$req->content_type('application/x-www-form-urlencoded');
$req->content($query);
my $res = $ua->request($req);
my $response = $res->content();
print $cgi->header(); print $response;
exit();

now what I want it too do is have script B display the final results instead of
script A having to post the results. If script A doesn't print out the
$response, the script produces a 500 error, even tho script B is producing a
valid header() and result. But the only way I can execute and complete process
is too allow script A to print out the header() and $response.

How can I code this so script B($post_url) print out the final results instead
of script A printing out the $response?

TIA
--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com