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

Why doesn't this script work?

Thread Next
From:
Octavian Rasnita
Date:
December 30, 2002 20:13
Subject:
Why doesn't this script work?
Message ID:
002701c2b083$0fd55a00$216fe9d5@microsoft.com
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,
Teddy's Center: http://teddy.fcc.ro/
Email: orasnita@home.ro



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About