Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Can't use Win32 Perl to FTP - no Net::FTP for Win32?

by hhalpin (Novice)
on Nov 04, 2000 at 05:23 UTC ( #39953=perlquestion: print w/replies, xml ) Need Help??
hhalpin has asked for the wisdom of the Perl Monks concerning the following question:

I need for my Perl Script for Win32 to ftp to remote sites and download and upload various files - and while I can find some Net modules that I have grown to love in Unix, I can't find my dear Net::FTP! I assume it hasn't been ported yet - which is rather odd.

However, Net::Telnet has - and I was wondering if I could use some combinations of this and Unix scripting to run ftp from a Perl-simulated Telnet session. I'm kinda old-fashioned so I just use the old Unix 'ftp', and am not sure how I can make a script to handle automating that process since it's interactive (with a different prompt no less!) and not a batch process. This causes problems with FTP and my limited knowledge of scripting. Remember - Net::Telnet works by the timeout parameter and the shell character parameter - and these could both mess up FTP due to the fact that the Unix 'ftp' shell has it's own shell character and long file transfers would timeout.

Please help me! This is for a vital project of mine, and I know Perl masters out there must have encountered this before.

Harry Halpin

  • Comment on Can't use Win32 Perl to FTP - no Net::FTP for Win32?

Replies are listed 'Best First'.
Re: Can't use Win32 Perl to FTP - no Net::FTP for Win32?
by Adam (Vicar) on Nov 04, 2000 at 05:41 UTC
    By "ported" do you mean that ActiveState hasn't made a version for use with PPM? You can always just use CPAN directly:
    prompt> perl -MCPAN -e shell
      this requires "make" however and make is not standard on windows...

        Perl isn't standard on Windows either. And make is even easier to get (just one program to download) and is free. See one of the Win32 Perl FAQs for location.

                - tye (but my friends call me "Tye")
Re: Can't use Win32 Perl to FTP - no Net::FTP for Win32?
by Fastolfe (Vicar) on Nov 04, 2000 at 06:20 UTC
    According to the Net::FTP entry at CPAN, this module works fine with Win32. It's strange that you'd have some libnet modules but not others. There's nothing binary about Net::FTP; it's 100% Perl, so I don't know why this wouldn't work for you on your platform.

    Try digging a little deeper with ActiveState (if you're using ActiveState's Perl), or look into installing the module from CPAN.

Re: Can't use Win32 Perl to FTP - no Net::FTP for Win32?
by quidity (Pilgrim) on Nov 04, 2000 at 07:18 UTC

    Net::FTP works fine under Windows. Install it using the PPM supplied with the ActiveState install.

RE (tilly) 1: Can't use Win32 Perl to FTP - no Net::FTP for Win32?
by tilly (Archbishop) on Nov 04, 2000 at 14:22 UTC
    While I would (of course) recommend the portable solution, I once solved a similar problem by using Win32::Internet which is on ActiveState machines by default.
Re: Can't use Win32 Perl to FTP - no Net::FTP for Win32?
by the_slycer (Chaplain) on Nov 04, 2000 at 10:39 UTC
    Well, I know I've had to reinstall libnet on pretty much every binary distribution of perl that I've installed (including the default slack install). So you might try that. If worse comes to worse and you really can't get this working, I'm going to suggest a non-perlish solution (I know - blasphemy!) If you drop to a command prompt and type in ftp /? on an NT or 2000 box you will receive the list of switches. One of these switches is to read commands from a "script" (basically just a text file with the proper commands in order). I have made use of this with a batch file and the "at" command to do regularily scheduled ftp's.

    But really, try and reinstall the libnet module, there will be a prompt during that process for ftp, and I'll be you can get it working through that.
Re: Can't use Win32 Perl to FTP - no Net::FTP for Win32?
by chromatic (Archbishop) on Nov 04, 2000 at 23:14 UTC
    the_slycer is correct. I had to fix this very thing yesterday on an ActiveState installation on NT.

    Try ppm install libnet -- that worked for me.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://39953]
Approved by root
[stevieb]:'re testing is a test system itself. 10+ documented issues fixed, another half dozen found while fixing the original ones. I'm getting there...
[stevieb]: Then throw in changes to Windows that throws everything you trusted right out the window.
[shmem]: that's why it is called "Windows"
[stevieb]: shmem thanks for the 'insight' :P
[shmem]: good thing that Sun already took "OpenWindows", otherwise I'd not stop to shudder imagining an "OpenWindows" from MS
[shmem]: more garbage in, more garbage out that would be
[stevieb]: I found that win10 broke a C# library I was using for one project while enhancing tests for a Perl dist, which breaks other Perl dists, and I'm about to throw my hands up on berrybrew. win2k12 broke one thing, win10 breaks something...
[stevieb]: ...unrelated which requires replacing a lot of code and a whole lib. I'm about to go nix only ffs
[shmem]: stevieb: what you're doing sounds afwully complex. Too much for me this evening to provide brighter insight ;-)

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2017-03-28 22:02 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (342 votes). Check out past polls.