in reply to Re^4: perl ftp
in thread perl ftp
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;
|
|---|