Ok, so I RTFM and came up with using ls rather than list.
#!/usr/bin/perl -w use strict; use Net::FTP; use Data::Dumper; my $FTPdHandle; my @FTPdDir; $FTPdHandle = Net::FTP->new('ftp.funet.fi', Debug=>1); $FTPdHandle->login("ftp","mypassword\@com.com"); $FTPdHandle->cwd("/pub"); @FTPdDir = $FTPdHandle->ls(); print Dumper(@FTPdDir); $FTPdHandle->quit;
Which In turn produced the output:
$VAR1 = 'CPAN'; $VAR2 = 'FreeBSD'; $VAR3 = 'Linux'; $VAR4 = 'NeXT'; $VAR5 = 'NetBSD'; $VAR6 = 'OS'; $VAR7 = 'README'; $VAR8 = 'TeX'; $VAR9 = 'X11'; $VAR10 = 'amiga'; $VAR11 = 'archive'; $VAR12 = 'astro'; $VAR13 = 'atari'; $VAR14 = 'cae'; .. .. <snip>
Which reconciled perfectly with me doing it manually via the cmd line.

Can I suggest using Data::Dumper to dump the contents of data structures rather than straight print? It will explicitily let you know if a value is undef, and if not it will recurse its way thru' any complex structures you many have. It also is very handy when you have the dereferencing blues to reverse engineer what you have already written (not that you'll ever need to reverse engineer what you've already written.. :-) )


In reply to Re: "canned" FTP by Ryszard
in thread "canned" FTP by PriNet

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.