Don't use ftp.pl. The first sentence in that file states:

This library is no longer being maintained, and is included for backward compatibility with Perl 4 programs which may require it.

Instead, check out Net::FTP or LWP.

Here is an example stolen from Net::FTP documentation:

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;

As for your next question...

I need to put this into the web, how do I integrate the file into website or what CGI should I write to execute(trigger) this program
... you're going to need to be more specific in describing exactly what you want to do.

If all you want to do is show a file from an FTP site when a user clicks on a link, consider linking directly to the file on that FTP site. Browsers know how to do FTP.

<a href="ftp://some.host.name/pub/that.file">click here</a>

If the FTP site requires a username and password and you don't mind letting the whole world know what they are, use:

<a href="ftp://username:password@some.host.name/pub/that.file">click h +ere</a>

-- Eric Hammond


In reply to Re: ftp.pl to retrieve a file by esh
in thread ftp.pl to retrieve a file by tja_ariani

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.