網上搜了一下,發現了這個文檔,其他基本就不用再看了:
http://search.cpan.org/~gbarr/libnet-1.22/Net/FTP.pm
為方便查閱,截取部分如下:
use Net::FTP; $ftp = Net::FTP->new("some.host.name", Debug => 0) or die "Cannot connect to some.host.name: $@"; $ftp->login("anonymous",'-anonymous@') or die "Cannot login ", $ftp->message; $ftp->cwd("/pub") or die "Cannot change working directory ", $ftp->message; $ftp->get("that.file") or die "get failed ", $ftp->message; $ftp->quit;
login ([LOGIN [,PASSWORD [, ACCOUNT] ] ])
Log into the remote FTP server with the given login information. If no arguments are given then the Net::FTP uses the Net::Netrc package to lookup the login information for the connected host. If no information is found then a login of anonymous is used. If no password is given and the login is anonymous then anonymous@ will be used for password.
If the connection is via a firewall then the authorize method will be called with no arguments.
authorize ( [AUTH [, RESP]])
This is a protocol used by some firewall ftp proxies. It is used to authorise the user to send data out. If both arguments are not specified then authorize uses Net::Netrc to do a lookup.
site (ARGS)
Send a SITE command to the remote server and wait for a response.
Returns most significant digit of the response code.
ascii
Transfer file in ASCII. CRLF translation will be done if required
binary
Transfer file in binary mode. No transformation will be done.
Hint: If both server and client machines use the same line ending for text files, then it will be faster to transfer all files in binary mode.
rename ( OLDNAME, NEWNAME )
Rename a file on the remote FTP server from OLDNAME to NEWNAME. This is done by sending the RNFR and RNTO commands.
delete ( FILENAME )
Send a request to the server to delete FILENAME.
cwd ( [ DIR ] )
Attempt to change directory to the directory given in $dir. If $dir is "..", the FTP CDUP command is used to attempt to move up one directory. If no directory is given then an attempt is made to change the directory to the root directory.