Re: Using wget within perl

[email protected] ("Jeff Peng")
Newsgroups perl.beginners
Message-ID <[email protected]>
On Thu, Jun 12, 2008 at 1:31 PM, stallomir <[email protected]> wrote:
> 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...
>

Seems it's due to the meta characters in the quoted url.
try add a statement:

$url = quotemeta($url);

before the wget system call.

Btw, why not using the pure perl way of getting a file?
LWP::Simple is really easy to do it.

-- 
Jeff Peng - [email protected]
Professional Squid supports in China
http://www.ChinaSquid.com/
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.