Subject: | File:Fetch does not use quotation marks while using wget |
While trying to download a URL as:
http://www.myweb.com/somefile.asp?var=100&anothervar=200
I receive the following error:
'wget' said it fetched 'somefile.asp?var=100&anothervar=200', but it was
not created at ./SomePerlScript.pl line (Some Line Number)
------------------------------------------------------------------------
sub _wget_fetch {
my $self = shift;
my %hash = @_;
my ($to);
my $tmpl = {
to => { required => 1, store => \$to }
};
check( $tmpl, \%hash ) or return;
### see if we have a wget binary ###
if( my $wget = can_run('wget') ) {
### no verboseness, thanks ###
my $cmd = [ $wget, '--quiet' ];
### if a timeout is set, add it ###
push(@$cmd, '--timeout=' . $TIMEOUT) if $TIMEOUT;
### run passive if specified ###
push @$cmd, '--passive-ftp' if $FTP_PASSIVE;
### add " to the end and the start of the uri
my $new_url = join('"',$self->uri,'"');
### set the output document, add the uri ###
push @$cmd, '--output-document', $to, $new_url;
### shell out ###
As can be seen I have added a join sub to add "URL" to the uri but this
was not helpful....
Idan Deshe.
deshe.idan@gmail.com