in reply to Re: Net::Ftp Issue
in thread Net::Ftp Issue

thanks apl! But no draw. The output gives me RETR and then the filename, which is correct, But still gives me the error "Bad file descriptor" I even copied and pasted that output and manually retreived the file and it was fine! I even made sure the path was correct ($ftp->pwd()). I suspect that the module may be inputting something else on the cmd line but how can I display that? Perhaps $ftp->message displays this (but not sure how to display it if it does) Can you provide some insight. Regards - perl newbie! :)

Replies are listed 'Best First'.
Re^3: Net::Ftp Issue
by apl (Monsignor) on Feb 04, 2008 at 21:28 UTC
    Have you tried repeating the sequence of ftp commands interactively? (You can always ls to confirm the existence of the file.)

    Perhaps you could do a ftp->dir();, to see if the file shows up in the directory listing?

    For that matter, you could manually do a ls -b on the directory in question. Perhaps there's a non-printable character in the name of the file you're interested in.

      Thanks apl, but how do I print out the results of ftp->ls?

      I tried:
      my $result = $ftp->ls;
      print $result;

      But it does not return a value.
      Hello apl, I believe my last post didn't go through. My apologies.
      But can you let me know how I can print out the results of $ftp->ls or $ftp->dir?
      I tried to apply the results into a scalar, but it didn't print out anything
      my $result = $ftp->ls;
      print $result;
      Thanks!
        $ftp->ls() returns an array or array reference depending on context. You should be getting an array reference they way you're calling it (and something like "ARRAY(0x401fa298)" the way you're printing it). If that's the problem then you can print "$_\n" for $ftp->ls(). If you're really getting nothing, then you have a different problem.