in reply to Struggles with Put in Net::FTP

Have you tried formatting the path using File::Spec? Other than that possibility, there should be no problem using Net::FTP with Linux, FTP is simply a protocal that does not care about the platform (as long as the server is running). You might be on to something if there are two copies of Net::FTP installed. You might look in the lib and site\lib directories to see if there are duplicates and try uninstalling Net::FTP and reinstalling it.

Replies are listed 'Best First'.
Re: Re: Struggles with Put in Net::FTP
by mchiles (Initiate) on May 25, 2004 at 22:42 UTC
    I have not tried formatting the path using File::Spec. I have looked through cpan on File::Spec but am unsure how to use it to be beneficial to me... Could you possibly provide an example?

    Good to hear that FTP should be no trouble with Linux (makes sense and I didn't think that would be it).

    I'll check more into duplicates and let you know... Thanks for your help!

    -Matt :)
      OK, to make use of File::Spec, look at the following sample:

      use File::Spec; my $file_path=File::Spec->catfile('C:','Path','To','File.exe'); print "$file_path\n";

      This will print:

      C:\Path\To\File.exe

      The advantage is, the module will put in the directory seperators for you, as appropriate for the OS. Also, you don't have to remember to escape the '\' character in a Windows path (basically making things cleaner). Also, it looks like you've got debug turned on, what kind of messages is it Net::FTP giving you?

        Thanks, I tried that and it formatted the path for me nicely so I know what the proper format should be... I think.

        I just posted a reply to the other monk on the thread who suggested that I may not be using Net::FTP as intended. Which makes me wonder if I am using File::Spec as intended... I ran the script as followed from a script on my linux host:
        use File::Spec; my $file_path=File::Spec->catfile('E:','test','picture.jpg'); print "File Path $file_path\n";
        It gave me the result File Path E:/test/picture.jpg which is good. But is that result the correct result for my home Win98 PC or is it actually the result for my linux host?

        -Matt :)