On Wed, 15 Sep 2004 [EMAIL PROTECTED] wrote:
> no nothing is showing up in the file.
Okay then, so this logging code is all hand-written ?
It seems then that nothing in this script is actually writing to the log
file you've asked for, because there's no such thing as "$ftp->$ftplog"
(or "$ftp->/usr/local/log/ftp_IrMt_scratchtapes.log" as it ends up.)
Let's keep this simple and remove the log entirely for now. Does a
stripped down version like what I have here work for you ?
my $scratchtps = qq[ whatever ];
ftpme( $scratchtps );
sub ftpme {
my $data = shift;
my $remotehost = "ftp.digitalarchives.com";
my $user = "cb100524";
my $pass = "xxxxxxx";
my $ftp = Net::FTP->new(
$remotehost, Debug => 10
) or die "cannot connect to $remotehost: IronMt: $!";
$ftp->login($user, $pass)
or die "cannot login: $!";
$ftp->ascii();
$ftp->cwd('archive');
$ftp->put($data)
or die "FTP put to IrMt failed: $!";
$ftp->quit;
}
This version should produce better diagnostic information, because it's
adding $! to the `die` phrases to output any error messages.
> Here is where I looked for information on Net::FTP
>
> http://search.cpan.org/~gbarr/libnet-1.19/Net/libnetFAQ.pod
>
> ok I will look in perldoc -f package. Is there a better place though?
If you're old-fashioned and like books, Damian Conway's _Object Oriented
Perl_ is an excellent manual for this side of Perl, and Randal Schwartz
and Tom Phoenix's _Perl Objects, References, and Modules_ is another.
Alternately, look over any Perl Object Oriented documentation online --
packages are a basic foundation of writing OO code.
--
Chris Devers
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>