k2 has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that I can't figure out what the digit 1 does...$ftp->rget( map{($_, 1)} @ARGV);
----------------> CODE <---------------- #!/usr/bin/perl use Net::FTP::Recursive; #################################################################### # will assume just a few args, as well as validity. #################################################################### usage() unless @ARGV >= 5; $host = shift; $username = shift; $passwd = shift; $remote_path = shift; #where to grab from $local_path = shift; #where to put dir structure on local box. chdir $local_path or die "could not change dir to $local_path!"; $ftp = Net::FTP::Recursive->new($host, Debug => 1); $ftp->login($username, $passwd) or die "Could not log in!"; $ftp->binary(); $ftp->cwd($remote_path); $ftp->rget( map{($_, 1)} @ARGV); $ftp->quit; sub usage { my($name) = $0; $name =~ s#.*/##; print STDERR "Usage: $name <host> <username> <passwd> <remote_path> +<local_path>\n"; exit; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: map question...
by djantzen (Priest) on Jun 16, 2003 at 20:57 UTC | |
by k2 (Scribe) on Jun 17, 2003 at 05:52 UTC | |
by djantzen (Priest) on Jun 17, 2003 at 06:33 UTC | |
Re: map question...
by sauoq (Abbot) on Jun 16, 2003 at 21:00 UTC | |
Re: map question...
by bbfu (Curate) on Jun 16, 2003 at 21:07 UTC | |
Re: map question...
by hossman (Prior) on Jun 17, 2003 at 05:20 UTC |