my $debug = ""; *Net::FTP::debug_print = sub { my ($cmd,$out,$txt) = @_; $debug .= $txt; }; my $ftp = Net::FTP->new("domain.tld", Debug => 1); $ftp->login( "user", "password" ); print $debug; __END__ Net::FTP(2.75) Exporter(5.58) Net::Cmd(2.26) IO::Socket::INET(1.31) IO::Socket(1.31) IO::Handle(1.28) 220 (vsFTPd 2.0.5) user user 331 Please specify the password. PASS password 230 Login successful.