Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unabel to connect to the online database through Ftp

Status
Not open for further replies.

1surya

Programmer
Jul 14, 2002
25
CA
I download Net::FTP module of perl and its working fine
i wrote a program called ftpfile is as follws

#! /usr/bin/perl -w
#ftpfile [servername] [directory] [filename]
use strict;
use Net::FTP;
my $hostname=" ";
my $directory= " ";
my $file_name= " ";
if(scalar @ARGV==0)
{
print "ftpfile [servername][directory][filename]","\n";
exit;
}
my $ftp=Net::FTP ->new($hostname) or die ("connect failed");
$ftp->login("anonymous",'raju_m_in@yahoo.com');
$ftp->binary;
$ftp->cwd("$directory");
$ftp->get("$file_name") or die("No file Found");
$ftp->quit;
exit;


thie program i put in the bin directory of my home and I edit the .bashrc file

in my actual program I am calling this file
though the system commnad and passing the argument

my $ifile="1b25.dssp";
this $ifile I am returning from a sub and it cahnges through $line of foreachloop
in the foreach loop I am using the following line to connect to the database

system "ftpfile ftp.embl-heidelberg.de pub/databases/protein_extras/dssp/ $ifile";
from the same program ealier i used to get the output but my system crashed and I reinstalled everything and try to retrive the files but I am not abel to and it gives me
the error
can not open the file

I am really in need of help can anybody help me
thanks in advance

 
I forgot to type this line in the earlier post
before my $ftp=Net::FTP->new($hostname)or die ("connect Failed");

($hostname, $directory,$file_name) =@ARGV;
but in my actual program I did
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top