srini_veera, what platform are you running this under? Windows? Linux? Solaris? HP-UX? And more specifically what shell? sh? csh? bash? ksh? The output should be going to STDERR not STDOUT. It's the shell syntax that you need to properly construct (and thats different for each shell) and we cannot help unless you tell us what shell you're running under.
If you don't want to be bothered with shell syntax, just close STDERR and re-open it to your log:
!/usr/bin/perl -w
use strict;
use Net::FTP;
# Capture STDERR
close( STDERR );
open( STDERR, ">mylog.txt" );
my $ftp = Net::FTP->new("some.host.name", Debug => 1)
or die "Cannot connect to some.host.name: $@";
$ftp->login("ftp",'foo@bar.com')
or die "Cannot login ", $ftp->message;
$ftp->cwd("/")
or die "Cannot change working directory ", $ftp->message;
$ftp->get("filename")
or die "get failed ", $ftp->message;
$ftp->quit;
|