Using wget within perl

[email protected] (stallomir)
Newsgroups perl.beginners
Organization http://groups.google.com
Message-ID <da6b5d9e-9300-4fb9-a81e-53718dfd4afa@w34g2000prm.googlegroups.com>
I want to wget several image files from a server at a time with the
same format. So, I am trying to write a perl script which calls wget
continuously, but with diffferent values of the variables. However,
when I use a system( "$foo")call, with $foo as the string with
variables, it doesn't seem to work, while if the wget command is used
at the terminal, it works just fine... Could anyone throw some light
on this matter?...The code is given below for reference...



#!/usr/bin/perl


$single = "http://casjobs.sdss.org/ImgCutoutDR6/getjpeg.aspx?
ra=18.87667&dec=-0.86083&scale=0.39612&width=400&height=400&opt=GST&query=SR(10,20)";

  system( "wget $single ")



After running this, I get the following error


sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `wget
http://casjobs.sdss.org/ImgCutoutDR6/getjpeg.aspx?ra=18.87667&dec=-0.86083&scale=0.39612&width=400&height=400&opt=GST&query=SR(10,20)
'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.