use Fcntl qw(O_WRONLY O_RDONLY O_APPEND O_CREAT O_TRUNC);
# use AutoLoader qw(AUTOLOAD);
-$VERSION = "2.62"; # $Id: //depot/libnet/Net/FTP.pm#64 $
+$VERSION = "2.65"; # $Id: //depot/libnet/Net/FTP.pm#68 $
@ISA = qw(Exporter Net::Cmd IO::Socket::INET);
# Someday I will "use constant", when I am not bothered to much about
{
my($ftp,$remote,$local,$where) = @_;
- my($loc,$len,$buf,$resp,$localfd,$data);
+ my($loc,$len,$buf,$resp,$data);
local *FD;
- $localfd = ref($local) || ref(\$local) eq "GLOB"
- ? fileno($local)
- : undef;
+ my $localfd = ref($local) || ref(\$local) eq "GLOB";
($local = $remote) =~ s#^.*/##
unless(defined $local);
$data = $ftp->retr($remote) or
return undef;
- if(defined $localfd)
+ if($localfd)
{
$loc = $local;
}
carp "Cannot write to Local file $local: $!\n";
$data->abort;
close($loc)
- unless defined $localfd;
+ unless $localfd;
return undef;
}
}
print $hashh "\n" if $hashh;
- unless (defined $localfd)
+ unless ($localfd)
{
unless (close($loc))
{
sub _store_cmd
{
my($ftp,$cmd,$local,$remote) = @_;
- my($loc,$sock,$len,$buf,$localfd);
+ my($loc,$sock,$len,$buf);
local *FD;
- $localfd = ref($local) || ref(\$local) eq "GLOB"
- ? fileno($local)
- : undef;
+ my $localfd = ref($local) || ref(\$local) eq "GLOB";
unless(defined $remote)
{
croak 'Must specify remote filename with stream input'
- if defined $localfd;
+ if $localfd;
require File::Basename;
$remote = File::Basename::basename($local);
croak("Bad remote filename '$remote'\n")
if $remote =~ /[\r\n]/s;
- if(defined $localfd)
+ if($localfd)
{
$loc = $local;
}
{
last unless $len = sysread($loc,$buf="",$blksize);
- if (trEBCDIC)
+ if (trEBCDIC && $ftp->type ne 'I')
{
$buf = $ftp->toascii($buf);
$len = length($buf);
{
$sock->abort;
close($loc)
- unless defined $localfd;
+ unless $localfd;
print $hashh "\n" if $hashh;
return undef;
}
print $hashh "\n" if $hashh;
close($loc)
- unless defined $localfd;
+ unless $localfd;
$sock->close() or
return undef;
- if ('STOU' eq uc $cmd and $ftp->message =~ m/unique\ file\ name:(.*)\)|"(.*)"/)
+ if ('STOU' eq uc $cmd and $ftp->message =~ m/unique\s+file\s*name\s*:\s*(.*)\)|"(.*)"/)
{
require File::Basename;
$remote = File::Basename::basename($+)
no arguments are given then the C<Net::FTP> uses the C<Net::Netrc>
package to lookup the login information for the connected host.
If no information is found then a login of I<anonymous> is used.
-If no password is given and the login is I<anonymous> then the users
-Email address will be used for a password.
+If no password is given and the login is I<anonymous> then I<anonymous@>
+will be used for password.
If the connection is via a firewall then the C<authorize> method will
be called with no arguments.
=for html <hr>
-I<$Id: //depot/libnet/Net/FTP.pm#64 $>
+I<$Id: //depot/libnet/Net/FTP.pm#68 $>
=cut