Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am using this to fetch data off a web page:
$content = get($url);
Now I want to grab files from this web page and download it to my NT workstation. I know there is a Perl FTP module and was hoping to see real world example of one that works so I can download files from a web site to my NT workstation. I know this involves some sort of Perl FTP module. I just need an example of a FTP that works.

Replies are listed 'Best First'.
Re: FTP
by broquaint (Abbot) on May 30, 2002 at 17:07 UTC
    Did you even look at the docs for Net::FTP ?
    use Net::FTP; $ftp = Net::FTP->new("some.host.name", Debug => 0); $ftp->login("anonymous",'-anonymous@'); $ftp->cwd("/pub"); $ftp->get("that.file"); $ftp->quit;
    Should be as easy as that, or if you're doing anonymous ftp access you could use the LWP::Simple module with even greater ease.
    use LWP::Simple; getstore 'ftp://ftp.somedomain.com/somefile.txt', 'somefile.txt';

    HTH

    _________
    broquaint

      hi, i m now having problem on Net::FTP. I'd setup ftp server on IIS on my win2k prof. then while i create a cgi script to get the file, lets say a picture file, i could retrieve that file and put into my own server. if i work on my web system, POST to the cgi script to get he file, failed, give me the error message : cant open the file, permission denied. i m really getting frustrated and dont know what's going wrong :( by the way, i would try on LWP::Simple see if can work.
Re: FTP Module Suggestions and Uses
by cjf (Parson) on May 30, 2002 at 17:06 UTC

    Net::FTP would be a suitable module. The docs have a few basic examples of how it's used.