Subject: | Use of uninitialized value in numeric ne (!=) at Net/SFTP/Foreign/Common.pm line 79. |
Date: | Fri, 21 Jun 2013 15:17:49 +0700 |
To: | <bug-Net-SFTP-Foreign [...] rt.cpan.org> |
From: | "Chinnawat Wipawapat" <ChinnawatWipawapat [...] th.venda.com> |
I'm using NET::SFTP::Foreign version 1.75 with best_effort enable due to
server has rejected to perform setstat() and found this warning ever
time it put file to sftp
Use of uninitialized value in numeric ne (!=) at
Net/SFTP/Foreign/Common.pm line 79.
$sftp->{_error} should be checked before perform any comparison
--- Net/SFTP/Foreign/Common.pm
+++ Net/SFTP/Foreign/Common.pm
@@ -76,7 +76,7 @@ sub _set_error {
}
else {
# FIXME: use a better approach to determine when some error is
fatal
- if ($sftp->{_error} !=
Net::SFTP::Foreign::Constants::SFTP_ERR_CONNECTION_BROKEN()) {
+ if (!defined $sftp->{_error} || $sftp->{_error} !=
Net::SFTP::Foreign::Constants::SFTP_ERR_CONNECTION_BROKEN()) {
$sftp->{_error} = 0;
}
}
Regards,
Chin