develooper Front page | perl.libwww | Postings from December 2002

Why doesn't this script work?

Thread Next
Octavian Rasnita
December 30, 2002 20:13
Why doesn't this script work?
Message ID:
Hi all,

I've tried to run the following script from command line under Windows and
it works fine, but if I run it from Internet Explorer, the page doesn't
print anything and it is still "Opening page...".

Can you tell me what could be the problem with it?

Thank you. Here is the script:

#!/perl/bin/perl -w

use strict;
use LWP::UserAgent;

my $ua = LWP::UserAgent -> new(env_proxy => 0,
timeout => 30,
keep_alive => 1,

my $request = HTTP::Request -> new('GET', 'http://localhost/');
my $response = $ua -> request($request);

my $content = $response -> content();

print "Content-type: text/html\n\n";
print $content;

Teddy's Center:

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About