[ABE.pm] Re: automating FTP in Perl
Faber Fedor
faber at linuxnj.com
Fri Dec 10 11:34:43 CST 2004
Okay, the Net::FTP is alot cleaner than using Expect.pm but I'm still
having problems with error logging, specifically, in my code I say:
$ftp->get($ftp_cfg{file}, $datafile)
or log_message("tag", "get failed $ftp->message") && die;
(where log_message is my function that just calls logger) and the error
report I get is:
Dec 10 12:39:28 myserver tag: get failed Net::FTP=GLOB(0x874b50c)->message
But, if I create the log message this way:
log_message("tag", "get failed " . $ftp->message) && die;
I get the "proper" error message:
Dec 10 12:45:46 myserver tag: get failed my20041210.csv: The system cannot find the file specified.
I was under the impression that the compiler would interpret everything
in the double quotes but here it obviously isn't. Why is that?
On another note, I'm assuming thatthe reason the "&& die" isn't executed
is because log_message returns nothing, right?
--
Regards,
Faber
Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com
More information about the ABE-pm
mailing list