Skip Menu |

This queue is for tickets about the LockFile-Simple CPAN distribution.

Report information
The Basics
Id: 76693
Status: new
Priority: 0/
Queue: LockFile-Simple

People
Owner: Nobody in particular
Requestors: CALDRIN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Deprecation warning for defined(@array)
In bleadperl LockFile::Simple generates deprecation warnings: defined(@array) is deprecated at /home/eserte/var/ctps/5159linux2/install/ perl-v5.15.9-134-g8aed2c6/lib/site_perl/5.15.9/LockFile/Simple.pm line 135. (Maybe you should just omit the defined()?) This in turn breaks tests of my module using LockFile::Simple. Please apply the attached patch to fix this issue. Thank you.
Subject: 0001-Fix-deprecated-defined-array.patch
From 6c242e57fcd0df168aa5644feb33a260d0c1b7ac Mon Sep 17 00:00:00 2001 From: Maik Hentsche <maik.hentsche@amd.com> Date: Thu, 19 Apr 2012 11:17:39 +0200 Subject: [PATCH] Fix deprecated "defined(@array)" defined(@array) is deprecated and even generates deprecation warning in perl5.15. Instead just checking @array in scalar context (i.e. if(@array) instead of if(defined(@array))) does the right thing. --- Simple.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Simple.pm b/Simple.pm index 74b4447..b19f20e 100644 --- a/Simple.pm +++ b/Simple.pm @@ -132,8 +132,8 @@ sub make { $self->{'lock_by_file'} = {}; # The logxxx routines are autoloaded, so need to check for @EXPORT - $self->{'wfunc'} = defined(@Log::Agent::EXPORT) ? \&logwarn : \&core_warn; - $self->{'efunc'} = defined(@Log::Agent::EXPORT) ? \&logerr : \&core_warn; + $self->{'wfunc'} = @Log::Agent::EXPORT ? \&logwarn : \&core_warn; + $self->{'efunc'} = @Log::Agent::EXPORT ? \&logerr : \&core_warn; $self->configure(@hlist); # Will init "manager" if necessary return $self; -- 1.7.5.4