X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fftp.pl;h=0b9d7321d6523896eb6b72e45f4d86b7644f1ac8;hb=6d5637c3050c14fb5c11ec5a05db33dce9e4a7a8;hp=e87a9b260c7dadd337238beda4f7df8ac04609e2;hpb=79072805bf63abe5b5978b5928ab00d360ea3e7f;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/ftp.pl b/lib/ftp.pl index e87a9b2..0b9d732 100644 --- a/lib/ftp.pl +++ b/lib/ftp.pl @@ -1,4 +1,13 @@ #-*-perl-*- +# +# This library is no longer being maintained, and is included for backward +# compatibility with Perl 4 programs which may require it. +# +# In particular, this should not be used as an example of modern Perl +# programming techniques. +# +# Suggested alternative: Net::FTP +# # This is a wrapper to the chat2.pl routines that make life easier # to do ftp type work. # Mostly by Lee McLoughlin @@ -65,7 +74,7 @@ # No longer call die expect on fatal errors. Just return fail codes. # Changed returns so higher up routines can tell whats happening. # Get expect/accept in correct order for dir listing. -# When ftp_show is set then print hashes every 1k transfered (like ftp). +# When ftp_show is set then print hashes every 1k transferred (like ftp). # Allow for stripping returns out of incoming data. # Save last error in a global string. # @@ -88,8 +97,9 @@ # Initial revision # -require 'chat2.pl'; -require 'socket.ph'; +require 'chat2.pl'; # into main +eval "require 'socket.ph'" || eval "require 'sys/socket.ph'" + || die "socket.ph missing: $!\n"; package ftp; @@ -140,7 +150,7 @@ $real_site = ""; $ftp_show = 0; sub ftp'debug { - $ftp_show = @_[0]; + $ftp_show = $_[0]; # if( $ftp_show ){ # print STDERR "ftp debugging on\n"; # } @@ -148,7 +158,7 @@ sub ftp'debug sub ftp'set_timeout { - $timeout = @_[0]; + $timeout = $_[0]; $timeout_open = $timeout; $timeout_read = 20 * $timeout; if( $ftp_show ){ @@ -245,7 +255,7 @@ sub ftp'login local( $remote_user, $remote_password ) = @_; if( $proxy ){ - &ftp'send( "USER $remote_user@$site" ); + &ftp'send( "USER $remote_user\@$site" ); } else { &ftp'send( "USER $remote_user" ); @@ -320,7 +330,7 @@ sub ftp'cwd # &ftp'dir( remote LIST options ) # Start a list goin with the given options. # Presuming that the remote deamon uses the ls command to generate the -# data to send back then then you can send it some extra options (eg: -lRa) +# data to send back then you can send it some extra options (eg: -lRa) # return 1 if sucessful and 0 on a failure sub ftp'dir_open {