|
Ok still not working. I add the code below to try and get a directory
listing and the array comes up empty. Also tried a get and it did not work. However
it I manually connect to the mainframes FTP site I have no problems. @entries = $ftp->dir($dir1);
foreach $file1 (@entries) { print("$file1\n"); } Help Thanks John Kennedy -----Original
Message----- Still not
working. I put the "." back in, but it makes no different. The
error I'm getting is "can't call read on an undefined value in line 30. This would be this [line $data.=$buf while
$download->read($buf,1000); ]. Also $download
is always empty probably causing this problem. Any ides Thanks John Kennedy -----Original
Message----- It's not working here is the code I'm using. Thanks John use Net::FTP; print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nThis
program will attempt to pull multiple ANI files (in sequence) from the
mainframes.\n"); print("Enter the user ID to use when connecting
to the mainframes: ");
#Prompt the user for input chop($username = <STDIN>); print "Enter the password for this ID:
"; #Prompt the user for input chop($password = <STDIN>); print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAttempting
to connect to first mainframe for file.\n"); $hostname = somehost.com'; $dir1 = "some_dir"; $ftp = Net::FTP->new($hostname);
# construct object $ftp->login($username, $password); $ftp->cwd("..");
# change directory $ftp->cwd($dir1);
# change directory print("Showing the current working directory as
'$dir1'\n");
$download=$ftp->retr($file);
$data=$buf while $download->read($buf,1000);
$download->close();
$ftp->quit; -----Original
Message-----
use Net::FTP;
$ftp=Net::FTP->new($host); $ftp->login($user,$pass); $download=$ftp->retr($file); #
now variable $data contains $file contents MaT -----Original
Message----- Does anybody know if there is a way to
manipulate the data stream using NET:: FTP, before the feed is written to a
file. What I want to do is parse the date before I write it to the file. Thanks John Kennedy |
Title: RE: Perl with FTP
