diff options
author | Graham Barr <gbarr@pobox.com> | 1999-09-18 16:34:49 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 1999-09-18 16:34:49 +0000 |
commit | ce943d01330cade0b20aa9c3565b0d64dfb276d4 (patch) | |
tree | e892614cd48d6062b915dcd3089cc4ec54506219 | |
parent | 2cbc4327c3c77bc1366ebb3d90853c3e879bfd75 (diff) | |
download | perl-libnet-ce943d01330cade0b20aa9c3565b0d64dfb276d4.tar.gz |
Net::FTP
- get and put now accept *FD as well as \*FD for the local filehandle
-rw-r--r-- | Net/Cmd.pm | 4 | ||||
-rw-r--r-- | Net/FTP.pm | 12 |
2 files changed, 9 insertions, 7 deletions
@@ -13,7 +13,7 @@ use strict; use vars qw(@ISA @EXPORT $VERSION); use Carp; -$VERSION = "2.15"; +$VERSION = "2.16"; @ISA = qw(Exporter); @EXPORT = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING); @@ -168,7 +168,7 @@ sub command { local $SIG{PIPE} = 'IGNORE'; - my $str = join(" ", map { tr/\n/ /; $_; } @_) . "\015\012"; + my $str = join(" ", map { /\n/ ? do { my $n = $_; $n =~ tr/\n/ /; $n } : $_; } @_) . "\015\012"; my $len = length $str; my $swlen; @@ -21,7 +21,7 @@ use Net::Cmd; use Net::Config; # use AutoLoader qw(AUTOLOAD); -$VERSION = "2.52"; # $Id: //depot/libnet/Net/FTP.pm#39 $ +$VERSION = "2.53"; # $Id: //depot/libnet/Net/FTP.pm#40 $ @ISA = qw(Exporter Net::Cmd IO::Socket::INET); # Someday I will "use constant", when I am not bothered to much about @@ -368,8 +368,9 @@ sub get my($loc,$len,$buf,$resp,$localfd,$data); local *FD; - $localfd = ref($local) ? fileno($local) - : undef; + $localfd = ref($local) || ref(\$local) eq "GLOB" + ? fileno($local) + : undef; ($local = $remote) =~ s#^.*/## unless(defined $local); @@ -597,8 +598,9 @@ sub _store_cmd my($loc,$sock,$len,$buf,$localfd); local *FD; - $localfd = ref($local) ? fileno($local) - : undef; + $localfd = ref($local) || ref(\$local) eq "GLOB" + ? fileno($local) + : undef; unless(defined $remote) { |