Gossamer Forum
Home : General : Perl Programming :

Problem with wget

Quote Reply
Problem with wget

The following works from the command line:


But it does not work from the following Perl script:



I get the message:

Number found where operator expected at wget1.pl line 3, near "//"
(Missing operator before
syntax error at wget1.pl line 3, near "wget http:"
Execution of wget1.pl aborted due to compilation errors.

I'm totally new to Perl, and would appreciate any help.

- Ivette
Quote Reply
Re: [Ivette] Problem with wget In reply to
Because you are trying to run a system command in your perl script without telling perl what you are trying to do.

Go to perldoc.com and in the search box on the main page enter "system"
Quote Reply
Re: [Ivette] Problem with wget In reply to
You would need something like this;



print "Content-type: text/html \n\n";
print "Done...";


Andy (mod)
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Problem with wget In reply to


system("wget > /path/to/file.CSV");

And make sure you at leaast add in some error checking =)

Last edited by:

Paul: Jun 20, 2003, 6:52 AM
Quote Reply
Re: [Paul] Problem with wget In reply to
Andy & Paul,

Thank you for your help. I'm not a sophisticated programmer (actually not a programmer at all), and appreciate your tips... definitely will take your advice of including some error checking.

I searched for "system" as you suggested, Paul, and found out that I could run a UNIX command in a Perl script by using



Now my little script is working!

- Ivette