in reply to Re: Any idea why LWP:Simple doesn't like this particular website?
in thread Any idea why LWP:Simple doesn't like this particular website?
which should just be exit so it won't try to print the empty $doc and get that nasty uninitialized value warning. Try this:die "$!";
This code is tested and works. If it doesn't work for you the problem may lie elsewhere...#!/usr/bin/perl -w use strict; # added use diagnostics; use CGI::Carp qw(fatalsToBrowser); use LWP::Simple; my$doc; my$theURL = 'http://www.theredkitchen.net/'; print "Content-type: text/html\n\n"; print "The script has successfully started up.\n\n<BR><BR>"; unless($doc=get($theURL)){ print "can't get the URL"; exit; # added } print $doc; exit;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Any idea why LWP:Simple doesn't like this particular website?
by Cody Pendant (Prior) on Jul 02, 2001 at 06:40 UTC |