Hi there. Right now I have a simple perl script that I'm trying to use to download some files from a FTP server, but for some reason that i don't understand it says ..
: bad interpreter: No such file or directory
When I try to run it. I have checked the location of both the ftp program and perl interpreter and they are both correct, and they are both definately installed and running just fine on my machine. I have no clue as to what is going on. The code is below
#!/usr/bin/perl
$pdblist = $ARGV[0];
$ftp = "/usr/bin/ftp";
$ftptmp1="filename1.txt";
$ftphost1 = "ftp.rcsb.org";
$ftpdir1 = "pub/pdb/data/structures/all/pdb/";
$pdb = "pdb";
$ent = ".ent";
open(PDBLIST, "$pdblist") || die "ERROR: Unable to open $pdblist FILE:
+ $!\n";
print "$pdblist\n"
while(<PDBLIST>)
{
@fields = split;
$pdbname = $fields[0];
$pdbname =~ tr/[A-Z]/[a-z]/;
$pdbfile = "$pdb$pdbname$ent";
# get pdb file from ftp site
print "Retrieving $pdbfile file from FTP site ...\n";
open(FTP, "|$ftp -n $ftphost1 > $ftptmp1");
print FTP "user anonymous ";
print FTP "password a.l.cuff\@qmul.ac.uk\n";
print FTP "cd $ftpdir1\n";
print FTP "bin\n";
print FTP "get $pdbfile\n";
print FTP "bye";
$pdbfileunzipped = substr($pdbfile, 0, 11);
print "Decompressing $pdbfileunzipped ... \n";
system("gunzip $pdbfile");
}
Can anyone see something wrong with this that I'm not seeing? Any help much appreciated. Thank you.