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.

In reply to Re: FTP by robin
in thread Capturing Net::FTP output by WintersMystic

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.