Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: FTP

by robin (Chaplain)
on Dec 28, 2001 at 16:40 UTC ( [id://134866]=note: print w/replies, xml ) Need Help??


in reply to Capturing Net::FTP output

It sounds as though you want to see the raw FTP commands and responses. You can pass the option     Debug => 1, as an argument to Net::FTP->new(). Alternatively, you can call $ftp->debug(1); on your Net::FTP object. The raw commands and responses will be printed to STDERR. Here's an example program:
#!/usr/bin/perl -w use strict; use Net::FTP; my $ftp = Net::FTP->new("ftp.cpan.org", Debug => 1); $ftp->login("anonymous", 'boutros@boutros-ghali.com'); $ftp->cwd("/pub/CPAN"); $ftp->get("README", '/tmp/CPAN-README'); $ftp->quit;
and its output:
Net::FTP: Net::FTP(2.58) Net::FTP: Exporter(5.562) Net::FTP: Net::Cmd(2.19) Net::FTP: IO::Socket::INET(1.25) Net::FTP: IO::Socket(1.26) Net::FTP: IO::Handle(1.21) Net::FTP=GLOB(0x1c1dbc)<<< 220 siobhra.indigo.ie FTP server (Version + 6.00) ready. Net::FTP=GLOB(0x1c1dbc)>>> user anonymous Net::FTP=GLOB(0x1c1dbc)<<< 331 Guest login ok, send your email addre +ss as password. Net::FTP=GLOB(0x1c1dbc)>>> PASS .... Net::FTP=GLOB(0x1c1dbc)<<< 230 Guest login ok, access restrictions a +pply. Net::FTP=GLOB(0x1c1dbc)>>> CWD /pub/CPAN Net::FTP=GLOB(0x1c1dbc)<<< 250 CWD command successful. Net::FTP=GLOB(0x1c1dbc)>>> PORT 62,136,150,113,192,10 Net::FTP=GLOB(0x1c1dbc)<<< 200 PORT command successful. Net::FTP=GLOB(0x1c1dbc)>>> RETR README Net::FTP=GLOB(0x1c1dbc)<<< 150 Opening ASCII mode data connection fo +r 'README' (1941 bytes). Net::FTP=GLOB(0x1c1dbc)<<< 226 Transfer complete. Net::FTP=GLOB(0x1c1dbc)>>> QUIT Net::FTP=GLOB(0x1c1dbc)<<< 221 Goodbye.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://134866]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-23 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found