Hi all,
I'm trying to use the module Net::FTP::Recursive to get an entire catalog-structure from an FTP-server.
I used the rget-script that came along with the module and it works fine, when I connect to a Unix/Linux FTP...
BUT (there's allways a but) it does NOT work when I connect to a Novell FTP-server.
So I had a look at the script and came across this line:
(se below for the entire script)
$ftp->rget( map{($_, 1)} @ARGV);
The problem is that I can't figure out what the digit 1 does...
I think/hope/guess that the 1 refers to the digit 1 that shows that it's is a
file and not a directory when I do a dir on the Unix/Linux FTP-server.
If so I know that the Novell FTP-server has a "-" to indicate that it's a file and not a directory,
but I can't seem to get the script to work if I change the "1" to a "-".
I havde read the Map: The Basicsand the Complex Sorting
but neither of them has made me see the light ;-)
They talk about BLOCK's but ($_, 1) has me somewhat confused...

So now I hope that someone in the Monastary has the time to shed some light on my problem...

TIA
k2
----------------> 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; }

In reply to map question... by k2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.