Operating System - HP-UX
1745788 Members
3920 Online
108722 Solutions
New Discussion юеВ

Perl vs shell scripts for FTP

 
SOLVED
Go to solution
Benjamin Cheong
Occasional Contributor

Perl vs shell scripts for FTP

Hi there,

I've noticed several threads discussing the automation of FTP using Perl and shell scripts and was wondering about the pro's and con's of either approach.

For example, how's the performance of Net::FTP compared to standard FTP?

Cheers,
Ben
5 REPLIES 5
KapilRaj
Honored Contributor

Re: Perl vs shell scripts for FTP

I had made a similier request and I found ,

1. It can give you a return code which shell script can not give you for a proper and improper file transfer.

Regds,

Kaps
Nothing is impossible
H.Merijn Brand (procura
Honored Contributor

Re: Perl vs shell scripts for FTP

I fully agree with Kapil, that that is the most important switch to choose for.

On avarage, the speed is not depending on the scripting language, but on the speed of your connection line.

Several smaal commands might be faster in shell, whereas a few large transfers are easier dealt with in Perl.

Due to the fact that errors are easier cought in Perl, retransfers are a breathe in perl, where it is a pita in sh scripts.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Scott Palmer_1
Trusted Contributor

Re: Perl vs shell scripts for FTP

Ben,

One of the other major benefits is that if you have a Windoz server set up properly, you can use the NetFTP module to automate ftp from windows to another platform, shell scripts aren't generally avaliable for windows OS. ( I know about the various Unix shell products... they dont count in this reply).

Scott
A. Clay Stephenson
Acclaimed Contributor

Re: Perl vs shell scripts for FTP

If you want something that is at best ugly, do it in Shell but make sure that you put FTP in verbose mode. Perl's NET::FTP instantly and easily gives you error checking and nice, clean code. The transfer performance will be indistinguishable.

The attached ftpput.pl should give a good starting point. Invoke as ftpput.pl -u for full usage.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Perl vs shell scripts for FTP

If you want something that is at best ugly, do it in Shell but make sure that you put FTP in verbose mode. Perl's NET::FTP instantly and easily gives you error checking and nice, clean code. The transfer performance will be indistinguishable.

The attached ftpput.pl should give a good starting point. Invoke as ftpput.pl -u for full usage.
If it ain't broke, I can fix that.