S
schnibitz
Hi everyone, the following code works from my linux shell as root or
the 'nobody' accounts:
-----------------------------
#!/usr/bin/perl
#use strict;
#use LWP::Simple;
use LWP::UserAgent;
#use URI::URL;
print "Content-type: text/html\n\n";
print <<HTML;
<html>
<head>
<title>TEST</title>
</head>
<body>
HTML
my $url_variable = $input{'URL'};
my $ua = new LWP::UserAgent;
$ua->timeout(120);
my $request = new HTTP::Request('GET', 'http://www.yahoo.com');
my $response = $ua->request($request);
my $content = $response->content();
print "$content";
print <<HTML;
</body>
</html>
</head>
HTML
---------------------------------
BUT when I hit that same .pl file with my browser I get the following
error:
500 Can't connect to www.yahoo.com:80 (Bad hostname 'www.yahoo.com')
Can someone help me please? I'm doing something idiotic, I know, and
anything you could do to help would be appreciated.
-G
the 'nobody' accounts:
-----------------------------
#!/usr/bin/perl
#use strict;
#use LWP::Simple;
use LWP::UserAgent;
#use URI::URL;
print "Content-type: text/html\n\n";
print <<HTML;
<html>
<head>
<title>TEST</title>
</head>
<body>
HTML
my $url_variable = $input{'URL'};
my $ua = new LWP::UserAgent;
$ua->timeout(120);
my $request = new HTTP::Request('GET', 'http://www.yahoo.com');
my $response = $ua->request($request);
my $content = $response->content();
print "$content";
print <<HTML;
</body>
</html>
</head>
HTML
---------------------------------
BUT when I hit that same .pl file with my browser I get the following
error:
500 Can't connect to www.yahoo.com:80 (Bad hostname 'www.yahoo.com')
Can someone help me please? I'm doing something idiotic, I know, and
anything you could do to help would be appreciated.
-G