use Net::FTP; use IO::Handle; open (OUTPUT, ">output.txt") or die $!; open (ERROR, ">error.txt") or die $!; STDOUT->fdopen(\*OUTPUT, "w") or die $!; STDERR->fdopen(\*ERROR, "w") or die $!; $ftp = Net::FTP->new("some.host.name", Debug => 1); $ftp->login("anonymous",'me@here.there'); $ftp->quit;
open (OUTPUT, ">output.txt") or die $!; open (ERROR, ">error.txt") or die $!;
STDOUT->fdopen(\*OUTPUT, "w") or die $!; STDERR->fdopen(\*ERROR, "w") or die $!;
$ftp = Net::FTP->new("some.host.name", Debug => 1); $ftp->login("anonymous",'me@here.there'); $ftp->quit;
That's 4 lines that nobody wants to see in any/all of their programs... the only issue is whether to support STDOUT and STDERR