perldoc > ftp

Found in /usr/share/perl/5.38/pod/perlfaq8.pod
  Can I use perl to run a telnet or ftp session?
    Try the Net::FTP, TCP::Client, and Net::Telnet modules (available from
    CPAN). <http://www.cpan.org/scripts/netstuff/telnet.emul.shar> will also
    help for emulating the telnet protocol, but Net::Telnet is quite
    probably easier to use.

    If all you want to do is pretend to be telnet but don't need the initial
    telnet handshaking, then the standard dual-process approach will
    suffice:

        use IO::Socket;             # new in 5.004
        my $handle = IO::Socket::INET->new('www.perl.com:80')
            or die "can't connect to port 80 on www.perl.com $!";
        $handle->autoflush(1);
        if (fork()) {               # XXX: undef means failure
            select($handle);
            print while <STDIN>;    # everything from stdin to socket
        } else {
            print while <$handle>;  # everything from socket to stdout
        }
        close $handle;
        exit;

Found in /usr/share/perl/5.38/pod/perlfaq9.pod
  How do I fetch/put an (S)FTP file?
    Net::FTP, and Net::SFTP allow you to interact with FTP and SFTP (Secure
    FTP) servers.

Generated by phpman v4.12.29 · Markdown · JSON Author: Che Dong Under GNU General Public License
2026-12-06 08:44 @216.73.216.5
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!