{
    "mode": "perldoc",
    "parameter": "ftp",
    "section": "-q",
    "url": "https://www.chedong.com/phpMan.php/perldoc/ftp/json",
    "generated": "2026-06-03T03:32:57Z",
    "sections": {
        "Found in /usr/share/perl/5.34/pod/perlfaq8.pod": {
            "content": "Can I use perl to run a telnet or ftp session?\nTry the Net::FTP, TCP::Client, and Net::Telnet modules (available from\nCPAN). <http://www.cpan.org/scripts/netstuff/telnet.emul.shar> will also\nhelp for emulating the telnet protocol, but Net::Telnet is quite\nprobably easier to use.\n\nIf all you want to do is pretend to be telnet but don't need the initial\ntelnet handshaking, then the standard dual-process approach will\nsuffice:\n\nuse IO::Socket;             # new in 5.004\nmy $handle = IO::Socket::INET->new('www.perl.com:80')\nor die \"can't connect to port 80 on www.perl.com $!\";\n$handle->autoflush(1);\nif (fork()) {               # XXX: undef means failure\nselect($handle);\nprint while <STDIN>;    # everything from stdin to socket\n} else {\nprint while <$handle>;  # everything from socket to stdout\n}\nclose $handle;\nexit;\n",
            "subsections": []
        },
        "Found in /usr/share/perl/5.34/pod/perlfaq9.pod": {
            "content": "How do I fetch/put an (S)FTP file?\nNet::FTP, and Net::SFTP allow you to interact with FTP and SFTP (Secure\nFTP) servers.\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Tools to interact with a server via File Transfer Protocol.",
        "examples": [
            {
                "description": "Connect to an FTP server and run in interactive mode",
                "command": "ftp {{ftp.example.com}}"
            },
            {
                "description": "Connect to an FTP server specifying its IP address and port",
                "command": "ftp {{ip_address}} {{port}}"
            },
            {
                "description": "[Interactive] Switch to binary transfer mode (graphics, compressed files, etc)",
                "command": "binary"
            },
            {
                "description": "[Interactive] Transfer multiple files without prompting for confirmation on every file",
                "command": "prompt off"
            },
            {
                "description": "[Interactive] Download multiple files (glob expression)",
                "command": "mget {{*.png}}"
            },
            {
                "description": "[Interactive] Upload multiple files (glob expression)",
                "command": "mput {{*.zip}}"
            },
            {
                "description": "[Interactive] Delete multiple files on the remote server",
                "command": "mdelete {{*.txt}}"
            },
            {
                "description": "[Interactive] Rename a file on the remote server",
                "command": "rename {{original_filename}} {{new_filename}}"
            }
        ]
    }
}