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

Re: Why doesn't this script work?

Thread Previous | Thread Next
From:
Octavian Rasnita
Date:
December 30, 2002 21:30
Subject:
Re: Why doesn't this script work?
Message ID:
01a601c2b08d$ec747e50$216fe9d5@microsoft.com
Of course the Apache is running the program but I call it from Internet
Explorer.
It is not a permissions problem because I run it under Windows 2000 with
FAT32.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: orasnita@home.ro

----- Original Message -----
From: "Michael A Chase" <mchase@ix.netcom.com>
To: <libwww@perl.org>; "Octavian Rasnita" <orasnita@home.ro>
Sent: Tuesday, December 31, 2002 6:40 AM
Subject: Re: Why doesn't this script work?


On Mon, 30 Dec 2002 09:40:31 +0200 Octavian Rasnita <orasnita@home.ro>
wrote:

> 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...".

??? How can Internet Explorer execute a Perl script?  At most it can
request a URL from a webserver which in turn runs the script.

> 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;

MSIE is a UserAgent, so is this script.  Neither can invoke the other.  It
looks like this script is meant to be called by a webserver for a URL
request which MSIE or any other browser or LWP script can submit.

If you are now wondering why the webserver isn't returning what you expect,
you need to look in the webserver's logs.  It's usually a problem of file
permissions or environment variables not being appropriate for the account
the webserver is running in.

--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.





Thread Previous | 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