#!/usr/bin/perl -w
use strict;
use Net::FTP;
my $ftp = Net::FTP->new('ftp')
or die("unable to connect: $@\n");
$ftp->login or die("Unable to login to ny4");
print "Message = ", $ftp->message(), "\n";
$ftp->put( 'foo' )
or die("Unable to write ftp.prep");
print "Message = ", $ftp->message(), "\n";
$ftp->quit;
####
Use of uninitialized value in -f at /opt/perl/lib/site_perl/5.6.1/Net/FTP.pm line 716.
####
sub _store_cmd
{
my($ftp,$cmd,$local,$remote) = @_;
my($loc,$sock,$len,$buf);
local *FD;
my $localfd = ref($local) || ref(\$local) eq "GLOB";
unless(defined $remote)
{
croak 'Must specify remote filename with stream input'
if $localfd;
require File::Basename;
$remote = File::Basename::basename($local);
}
if( defined ${*$ftp}{'net_ftp_allo'} )
{
delete ${*$ftp}{'net_ftp_allo'};
} else
{
# if the user hasn't already invoked the alloc method since the last
# _store_cmd call, figure out if the local file is a regular file(not
# a pipe, or device) and if so get the file size from stat, and send
# an ALLO command before sending the STOR, STOU, or APPE command.
$ftp->_ALLO(-s _) if -f $loc; # no ALLO if sending data from a pipe
}
####
$ftp->_ALLO(-s _) if -f $loc; # no ALLO if sending data from a pipe