aedificum has asked for the wisdom of the Perl Monks concerning the following question:
Now, the majority of my script works and the reformatted files are placed into a directory ( lets call it /output ). This code snippet is the last, untested, part that uses NET:FTP to transfer the files out of that directory.
# read through the directory containing all of the formatted # .ord files processed above and ftp them to SAP. delete the # files when after they have been transfered. use NET::FTP; my $hostname='secret.server.mycompany.com; my $user='anonymous'; my $password='anonymous'; my $ftp=Net::FTP -> new($hostname); ftp->login($username,$password); $ftp->ascii; chdir( "output/$dir" ); opendir( DIR, "output/$dir" ); @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;
Please remember that I am only a student and am still trying to learn. I know there are probably a gazillion better ways to do everything I have written and I would be glad to learn them all. Thanks for the help :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Alternative to NET::FTP
by swiftone (Curate) on Jun 20, 2000 at 00:15 UTC | |
by aedificum (Sexton) on Jun 20, 2000 at 01:32 UTC | |
by gnat (Beadle) on Jun 20, 2000 at 02:24 UTC | |
by chromatic (Archbishop) on Jun 20, 2000 at 01:48 UTC | |
by merlyn (Sage) on Jun 20, 2000 at 01:33 UTC | |
by aedificum (Sexton) on Jun 20, 2000 at 01:43 UTC | |
by merlyn (Sage) on Jun 20, 2000 at 02:20 UTC | |
by aedificum (Sexton) on Jun 20, 2000 at 01:36 UTC | |
|
Re: Alternative to NET::FTP
by c-era (Curate) on Jun 20, 2000 at 00:28 UTC |