Dear Adam, I have an small perl script (see below) to retrieve a list of
files whose filenames are listed in a file that is the the input of the
program. The program runs as it follows:  getpdb.pl file; and "file"
just contain the two following entries
2vaa
2vac

Somehow, I only cant get the first file, but not the second. I tried
several things I do not know what I am doing wrong. The script is
included in this e-mail and I will very happy if someone could let me
know what I am doing wrong.
Regards

Pedro
This is the script
#!/usr/bin/perl
use Net::FTP::Common;
my @pdbs = <>;

getpdb(@pdbs);

sub getpdb {
    my @ent = @_;
    print "$ent[0]$ent[1]";

    #my $pdbentry=$_[0];


    my $dir = ".";
    my $ftphost = "ftp.rcsb.org";
    my $ftpdir = "/pub/pdb/data/structures/all/pdb";
    my $username = "anonymous";
    my $password = "anonymous";

    $ftp = Net::FTP->new("$ftphost")  or print "Can't connect: $@\n";
    $ftp->login($username, $password) or print "Couldn't login\n";
    $ftp->cwd($ftpdir)                or print "Couldn't change
directory\n";
    $ftp->type("I")                   or print "Couldn't change to
binary\n";

    foreach my $key (@ent){
     chomp($key);
     $key  =~ tr/[A-Z]/[a-z]/;
        my $pdbentry = $key;
     my $rcsbfile = "pdb" . $key . ".ent.Z";
     $ftp->get("$ftpdir/$rcsbfile", "$dir/${pdbentry}.pdb.Z")    or
print "Can't get $pdbentry\n";
 system("gunzip $dir/${pdbentry}.pdb.Z");
    }
}

--
*******************************************************************
PEDRO A. RECHE , pHD            TL: 617 632 3824
Dana-Farber Cancer Institute,   FX: 617 632 4569
Harvard Medical School,         EM: [EMAIL PROTECTED]
44 Binney Street, D1510A,       EM: [EMAIL PROTECTED]
Boston, MA 02115                URL:
http://www.reche.org
*******************************************************************

Reply via email to