Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Locale-Maketext CPAN distribution.

Report information
The Basics
Id: 55461
Status: resolved
Priority: 0/
Queue: Locale-Maketext

People
Owner: TODDR [...] cpan.org
Requestors: develop [...] traveljury.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.13
  • 1.13_80
  • 1.13_81
  • 1.13_82
Fixed in: 1.15_01



Subject: defined %hash deprecated in Perl 5.11
Hiya Perl 5.11 complains about checks for defined %hash: defined(%hash) is deprecated at /export/home/stro/perl5115/lib/5.11.5/Locale/Maketext.pm line 404. (Maybe you should just omit the defined()?) The patch below removes that warnings and the test suite runs fine: --- Locale-Maketext-1.13_82-old//lib/Locale/Maketext.pm 2009-06-24 04:23:47.000000000 +0200 +++ Locale-Maketext-1.13_82-new//lib/Locale/Maketext.pm 2010-03-11 08:34:01.000000000 +0100 @@ -401,7 +401,7 @@ my $module = $_[0]; # ASSUME sane module name! { no strict 'refs'; return($tried{$module} = 1) - if defined(%{$module . '::Lexicon'}) or defined(@{$module . '::ISA'}); + if (%{$module . '::Lexicon'}) or (@{$module . '::ISA'}); # weird case: we never use'd it, but there it is! } thanks Clint
Show quoted text
> Perl 5.11 complains about checks for defined %hash: > > defined(%hash) is deprecated at > /export/home/stro/perl5115/lib/5.11.5/Locale/Maketext.pm line 404. > (Maybe you should just omit the defined()?)
FWIW, older perl's perldoc -f defined says: Use of "defined" on aggregates (hashes and arrays) is deprecated. It used to … You should instead … They just never warned about it :)
This github patch fixes things, though it's on the end of a few other proposed patches so might not apply cleanly by it's self. http://github.com/toddr/perl/commit/0e337e1492f76b6471ff8676288400521e7a685d.patch
Subject: patch.txt
From 0e337e1492f76b6471ff8676288400521e7a685d Mon Sep 17 00:00:00 2001 From: Todd Rinaldo <toddr@cpan.org> Date: Mon, 15 Mar 2010 16:30:54 -0500 Subject: [PATCH] Locale::Maketext was checking for defined hash/array. Adjusted test to orthodox method --- dist/Locale-Maketext/lib/Locale/Maketext.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/Locale-Maketext/lib/Locale/Maketext.pm b/dist/Locale-Maketext/lib/Locale/Maketext.pm index 1ad9712..9bb9281 100644 --- a/dist/Locale-Maketext/lib/Locale/Maketext.pm +++ b/dist/Locale-Maketext/lib/Locale/Maketext.pm @@ -11,7 +11,7 @@ use I18N::LangTags::Detect (); BEGIN { unless(defined &DEBUG) { *DEBUG = sub () {0} } } # define the constant 'DEBUG' at compile-time -$VERSION = '1.13_87'; +$VERSION = '1.13_88'; $VERSION = eval $VERSION; @ISA = (); @@ -430,7 +430,7 @@ sub _try_use { # Basically a wrapper around "require Modulename" my $module = $_[0]; # ASSUME sane module name! { no strict 'refs'; return($tried{$module} = 1) - if defined(%{$module . '::Lexicon'}) or defined(@{$module . '::ISA'}); + if (%{$module . '::Lexicon'} or @{$module . '::ISA'}); # weird case: we never use'd it, but there it is! } -- 1.6.4.3
This was corrected in blead by p5p commit 9e20cf84778bac51ffe94978daf563a46792580a Author: Nicholas Clark <nick@ccl4.org> Date: Fri Oct 23 21:30:43 2009 +0100 In Locale::Maketext, avoid using defined @array and defined %hash.
1.15_02 is the RC for 1.16. No issues so far. closing ticket.