All,
I am having a problem with this small script. The program is supposed to go get a web page and strip off the headers and print the page to the browser. I runs perfectly from the command prompt. It prints the text to the screen without a problem. However when I call this as a CGI it only prduces the html tags and doesn't print the value of the $page variable to the browser. What would cause this? I am having the same problem with the altavista.cgi script.
Thanks,
Jim
jim@avera.net
#!/usr/bin/perl
use LWP::Simple;
#retrieve the page
my $page = get("http://headlines.isyndicate.com/rcscript/?user=7azhsswa");
$page =~ s/\n//g;
#dump the HEAD-part
$page =~ s/^.*<\/head>//is;
#dump the last tags
$page =~ s/<\/body>.*$//is;
print "Content-type: text/html\n\n";
print <<"html_here";
<html>
<head>
<title> Todays Daily News Headlines </title>
</head>
<body>
$page
</body>
</html>
html_here
I am having a problem with this small script. The program is supposed to go get a web page and strip off the headers and print the page to the browser. I runs perfectly from the command prompt. It prints the text to the screen without a problem. However when I call this as a CGI it only prduces the html tags and doesn't print the value of the $page variable to the browser. What would cause this? I am having the same problem with the altavista.cgi script.
Thanks,
Jim
jim@avera.net
#!/usr/bin/perl
use LWP::Simple;
#retrieve the page
my $page = get("http://headlines.isyndicate.com/rcscript/?user=7azhsswa");
$page =~ s/\n//g;
#dump the HEAD-part
$page =~ s/^.*<\/head>//is;
#dump the last tags
$page =~ s/<\/body>.*$//is;
print "Content-type: text/html\n\n";
print <<"html_here";
<html>
<head>
<title> Todays Daily News Headlines </title>
</head>
<body>
$page
</body>
</html>
html_here