Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formatting output from second script

Status
Not open for further replies.

Headmaster

Technical User
Nov 27, 2002
79
US
The actual question is: how can I print the output from another script that is already formatted as html. That is the only output I need in the script. I'm still searching other sources, but if somebody has a solution...

Here's the code I'm struggling with:

use LWP::UserAgent;
use HTTP::Request::Common qw(POST);
$ua = LWP::UserAgent->new;
$query->append('x_Response_Code','1');
my $req = POST ' [ map { $_ => $query->param($_) } $query->param() ];
print $ua->request($req)->as_string;

If I include
print "Content-type: text/html\n\n";
or
print "Content-type: text/plain\n\n";
or
print header,start_html('test')etc...

The test3 script's output is in html already, so when I return it, the headers from test3 print out in the browser as text. If I leave only the print $ua.... line, it throws up, as it is supposed to.

I'm missing something...what is it (besides lots more knowledge.)

Thanks for the replies!
 
What are the first three or four lines of the return value from $ua->request($req)->as_string?

"As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top