Note: The list of authors isn't current because its not maintained anymore. I only use it for examples. Update: Or you could use a glob and ls:#!/usr/bin/perl use Net::FTP; use Data::Dumper::Concise; use constant HOST => 'ftp.cpan.org'; use constant DIR1 => '/pub/CPAN/authors'; my $ftp = Net::FTP->new( HOST, Debug => 1, Passive => 1, Timeout => 1 ); $ftp->login('anonymous'); $ftp->cwd(DIR1); print Dumper $ftp->dir(<DIR1>); $ftp->quit;
#!/usr/bin/perl use Net::FTP; use Data::Dumper::Concise; use constant HOST => 'ftp.cpan.org'; use constant DIR1 => '/pub/CPAN/authors'; use constant GLOB => '*.???'; my $ftp = Net::FTP->new( HOST, Debug => 1, Passive => 1, Timeout => 1 ); $ftp->login('anonymous'); $ftp->cwd(DIR1); print Dumper $ftp->ls(<GLOB>); $ftp->quit;
In reply to Re^2: Get contents in an FTP path using glob
by Khen1950fx
in thread Get contents in an FTP path using glob
by toastbread
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |