in reply to replacement for LWP::Simple ?

Hi, Running the following script with debugger:
#!/usr/local/bin/perl -w use lib '.'; use LWP::Simple; $myDocument = get "http://www.ecst.csuchico.edu/"; print "Content-type: text/html\n\n", $myDocument;

I received

Useless use of a variable in void context at /docs/cust-bin/test.cgi
line 6. Content-type: text/html
Jacek

Replies are listed 'Best First'.
Re: Re: replacement for LWP::Simple ?
by Util (Priest) on May 14, 2002 at 14:28 UTC

    Did you cut-and-paste that script when you posted it above? When I run it, it works fine. It is a 5 line script, with the last statement beginning on line 5, and continued onto line 6; errors in the part of the statement on line 6 would be reported as line 5. If you mis-keyed the last line with a semi-colon in place of the comma, then you would get the exact error you described.

    # Bad semi-colon here..............* print "Content-type: text/html\n\n"; $myDocument;