Last active
May 18, 2016 21:02
-
-
Save sestaton/0bdbd3cb554bfa2ab02dd8426a024997 to your computer and use it in GitHub Desktop.
get ncbi ftp listing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Net::FTP; | |
my $host = "ftp.ncbi.nlm.nih.gov"; | |
my $wdir = "/genomes/refseq/"; | |
my $ftp = Net::FTP->new($host, Passive => 1, Debug => 0) | |
or die "Cannot connect to $host: $@"; | |
$ftp->login or die "Cannot login ", $ftp->message; | |
$ftp->cwd($wdir) | |
or die "Cannot change working directory ", $ftp->message; | |
my @list = $ftp->ls(); | |
print scalar(@list); | |
$ftp->quit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment