[Israel.pm] Net::FTP

Georges EL OJAIMI g-ojaimi at cyberia.net.lb
Sun Feb 6 13:35:54 PST 2005


Hello,

I have a small procedure to upload certain files to a web server, after
successful connection, I am getting "Bad file descriptor" while putting
the file on the server!
Any suggestion?

The code is as follow:

use strict;
use FileHandle;
use LWP::Simple;
use Net::FTP;

   my $host = "certainhost.com";
   my $user = "ftpuser";
   my $password="ftppass";

   my $file1 = "m1-customer-name.txt";
   my $file2 = "m2-occasion.txt";
   my $file3 = "m3-address-out.txt";
   my $file4 = "m4-address-in.txt";
   my $file5 = "m5-email.txt";

   my $ftp=Net::FTP->new($host);
   $ftp->login($user,$password) or die "could not login";y
   $ftp->ascii;
   $ftp->put($file1) or die "could not put $file1: $!";
   $ftp->put($file2) or die "could not put $file2: $!";
   $ftp->put($file3) or die "could not put $file3: $!";
   $ftp->put($file4) or die "could not put $file4: $!";
   $ftp->put($file5) or die "could not put $file5: $!";
   $ftp->quit();






More information about the Perl mailing list