Operating System - HP-UX
1834395 Members
1690 Online
110066 Solutions
New Discussion

re:How to write error message from ftp command to a log file in perl

 
Jing_6
Occasional Contributor

re:How to write error message from ftp command to a log file in perl

My system admin can't figure out the configuration to install Net::FTP modules in the HPUX. i am writing a program it require to check the directory and ftp all files to remote place. since i can't use the Net::FTP module, i am using the ftp command in my code. attached is my code for ftp a file. how can i get all the error messages and write to a logfile and to find out if there is sth wrong with the ftp connection or the directory is not exist ...? thanks
2 REPLIES 2
Ron Kinner
Honored Contributor

Re: re:How to write error message from ftp command to a log file in perl

Could you repost your attachment with a .txt extension? I can't open it without perl trying to run it.

Ron
A. Clay Stephenson
Acclaimed Contributor

Re: re:How to write error message from ftp command to a log file in perl

It's rather pointless to attach a Perl script (that I wrote) that uses Net::FTP when you say that your admin can't install Net::FTP. If you had at least made an attempt at this I might have tried to help.

The real fix here is to get Net::FTP installed; it's very easy.

The instructions are here:
http://www.cpan.org/modules/INSTALL.html

The good news about Net::FTP is that there is no C code; it's a pure Perl install. The even better news is that if you install a relatively modern version of Perl (e.g. 5.6.1 or later), Net::FTP is bundled with it. If you are running the very olf version of Perl under /usr/contrib then the very first thing you should do in install a lter version of Perl. It's on any Application CD Set at 11.x or you can download from any of the HP-UX Porting Centre's.
If it ain't broke, I can fix that.