I need to see if anyone has ever had a Bad File Descriptor problem when trying to ftp from a Perl script. If someone could help me with this code I would be greatful, I have tried everything except something that works. I get logged in to the ftp server and see the folder but when I try to put I get that error. Thanks in advanced.
#! c:\perl\bin\perl.exe -w use Net::FTP; # Login info my $host='ernie'; my $user='bert'; my $password='orange'; #print $user; # Change Dir After Login to this dir: my $remote_directory='d:/inetpub/ftproot/carquest'; my $remote_file='pull.txt'; my $home_directory='c:/ftp'; my $file='ftpout.txt'; my $fname="$home_directory/$file"; #print "$fname\n"; $ftp=Net::FTP->new ($host,Timeout=>240); $ftp->login($user, $password) or die "Couldn't login\n"; print "Your are logged in to $host.\n"; $ftp->ascii; #$ftp->get ($remote_file, $home_directory) or die # "Can't get remotefiles: $!\n"; $ftp->put ($fname, $remote_directory) or die "OOPS! Can't send localfiles: $!\n"; print "All files have been transmitted to $host.\n"; $ftp->quit; print "Everything is done.\n";

In reply to Ftp Script by mallen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.