in reply to Re: Alternative to NET::FTP
in thread Alternative to NET::FTP
I get an error: Can't call "new" in empty package "Net:FTP"
I have tried playing around with the directory listing in the use lib statement but nothing seems to work.
Here is a refined version of my original code with some of the bugs removed:
use lib "script/libnet/Net/FTP.pm"; $ftp = Net::FTP->new("ftp.mycompany.com"); $ftp->login("anonymous","anonymous"); $ftp->ascii; chdir( "$dir/$output" ); opendir( DIR, "$dir/output" ); @files = readdir( DIR ); # transfer all of the output files # in the output directory to SAP. foreach( @files ) { $filehandle = $_; $ftp->put("output/$filehandle"); unlink( "$filehandle" ); } # end foreach $ftp->quit;
|
|---|