Skip Menu |

This queue is for tickets about the Syntax-Feature-EachOnArray CPAN distribution.

Report information
The Basics
Id: 84728
Status: resolved
Priority: 0/
Queue: Syntax-Feature-EachOnArray

People
Owner: Nobody in particular
Requestors: gavin [...] openfusion.com.au
Cc:
AdminCc:

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



Subject: Missing imports in KeysOnArray and ValuesOnArray?
Hi Steven, The keys.t and values.t tests are failing on perl 5.8 and perl 5.10 with: Undefined subroutine &Syntax::Feature::KeysOnArray::akeys called at t/keys.t line 11 Undefined subroutine &Syntax::Feature::ValuesOnArray::avalues called at t/values.t line 11 Comparing EachOnArray (which is succeeding) with KeysOnArray and ValuesOnArray, the latter seem to be missing imports of akeys and avalues from their corresponding Tie::ArrayOnHash packages. I've attached simple patches based on EachOnArray which seem to fix the issue here. Cheers, Gavin
Subject: Syntax-Feature-ValuesOnArray-export-fix.patch
From 774c3ad6fc860dcf86b344578d484b92900a497c Mon Sep 17 00:00:00 2001 From: Gavin Carr <gavin@openfusion.com.au> Date: Fri, 19 Apr 2013 10:20:23 +1000 Subject: [PATCH] Add missing avalues export to Syntax::Feature::ValuesOnArray. --- lib/Syntax/Feature/ValuesOnArray.pm | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/lib/Syntax/Feature/ValuesOnArray.pm b/lib/Syntax/Feature/ValuesOnArray.pm index 38e5ab1..92a26b5 100644 --- a/lib/Syntax/Feature/ValuesOnArray.pm +++ b/lib/Syntax/Feature/ValuesOnArray.pm @@ -8,6 +8,12 @@ use Scalar::Util qw(reftype); package Tie::ArrayAsHash; +use base qw(Exporter); +BEGIN { + our @EXPORT_OK = 'avalues'; + $INC{'Tie/ArrayAsHash.pm'} = __FILE__; +}; + sub avalues (\[@%]) { my $thing = shift; return values %$thing @@ -25,6 +31,8 @@ sub avalues (\[@%]) { package Syntax::Feature::ValuesOnArray; +use Tie::ArrayAsHash qw(avalues); + sub install { my $class = shift; my %args = @_; -- 1.7.1
Subject: Syntax-Feature-KeysOnArray-export-fix.patch
From b26c7569eed2cf629bc9d1db773d4aaf6b47dcd3 Mon Sep 17 00:00:00 2001 From: Gavin Carr <gavin@openfusion.com.au> Date: Fri, 19 Apr 2013 10:17:28 +1000 Subject: [PATCH] Add missing akeys export to Syntax::Features::KeysOnArray. --- lib/Syntax/Feature/KeysOnArray.pm | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/lib/Syntax/Feature/KeysOnArray.pm b/lib/Syntax/Feature/KeysOnArray.pm index be2f339..de7b58b 100644 --- a/lib/Syntax/Feature/KeysOnArray.pm +++ b/lib/Syntax/Feature/KeysOnArray.pm @@ -8,6 +8,12 @@ use Scalar::Util qw(reftype); package Tie::ArrayAsHash; +use base qw(Exporter); +BEGIN { + our @EXPORT_OK = 'akeys'; + $INC{'Tie/ArrayAsHash.pm'} = __FILE__; +}; + sub akeys (\[@%]) { my $thing = shift; return keys %$thing @@ -25,6 +31,8 @@ sub akeys (\[@%]) { package Syntax::Feature::KeysOnArray; +use Tie::ArrayAsHash qw(akeys); + sub install { my $class = shift; my %args = @_; -- 1.7.1
Hi Gavin, Thanks for the report. Instead of using Exporter, I'm referring to the function with fully qualified names. Seems to work on my 5.10. Releasing 0.04. Regards, Steven -------------------------------------------------------------------------- commit af63190 Author: Steven Haryanto (on PC) <stevenharyanto@gmail.com> Date: Fri Apr 19 08:56:01 2013 +0700 Make KeysOnArray and ValuesOnArray work on 5.8 and 5.10 [RT#84728] diff --git a/lib/Syntax/Feature/KeysOnArray.pm b/lib/Syntax/Feature/KeysOnArray.pm index fb3069c..c57cc7c 100644 --- a/lib/Syntax/Feature/KeysOnArray.pm +++ b/lib/Syntax/Feature/KeysOnArray.pm @@ -31,7 +31,7 @@ sub install { return unless $^V lt 5.12.0; no strict 'refs'; - *{"$args{into}::keys"} = \&akeys; + *{"$args{into}::keys"} = \&Tie::ArrayAsHash::akeys; } # XXX on uninstall, delete symbol diff --git a/lib/Syntax/Feature/ValuesOnArray.pm b/lib/Syntax/Feature/ValuesOnArray.pm index 50f2860..e9677f3 100644 --- a/lib/Syntax/Feature/ValuesOnArray.pm +++ b/lib/Syntax/Feature/ValuesOnArray.pm @@ -31,7 +31,7 @@ sub install { return unless $^V lt 5.12.0; no strict 'refs'; - *{"$args{into}::values"} = \&avalues; + *{"$args{into}::values"} = \&Tie::ArrayAsHash::avalues; } # XXX on uninstall, delete symbol --------------------------------------------------------------------------
Subject: Re: [rt.cpan.org #84728] Missing imports in KeysOnArray and ValuesOnArray?
Date: Fri, 19 Apr 2013 13:06:00 +1000
To: steven haryanto via RT <bug-Syntax-Feature-EachOnArray [...] rt.cpan.org>
From: Gavin Carr <gavin [...] openfusion.com.au>
Hi Steven, Confirm 0.04 is working fine here too. Thanks! Cheers, Gavin On Thu, Apr 18, 2013 at 09:58:31PM -0400, steven haryanto via RT wrote: Show quoted text
Show quoted text
> Hi Gavin,
Show quoted text
> Thanks for the report. Instead of using Exporter, I'm referring to the function with fully qualified names. Seems to work on my 5.10.
Show quoted text
> Releasing 0.04.
Show quoted text
> Regards, > Steven
Show quoted text
> -------------------------------------------------------------------------- > commit af63190 > Author: Steven Haryanto (on PC) <stevenharyanto@gmail.com> > Date: Fri Apr 19 08:56:01 2013 +0700
Show quoted text
> Make KeysOnArray and ValuesOnArray work on 5.8 and 5.10 [RT#84728]
Show quoted text
> diff --git a/lib/Syntax/Feature/KeysOnArray.pm b/lib/Syntax/Feature/KeysOnArray.pm > index fb3069c..c57cc7c 100644 > --- a/lib/Syntax/Feature/KeysOnArray.pm > +++ b/lib/Syntax/Feature/KeysOnArray.pm > @@ -31,7 +31,7 @@ sub install {
Show quoted text
> return unless $^V lt 5.12.0; > no strict 'refs'; > - *{"$args{into}::keys"} = \&akeys; > + *{"$args{into}::keys"} = \&Tie::ArrayAsHash::akeys; > }
Show quoted text
> # XXX on uninstall, delete symbol > diff --git a/lib/Syntax/Feature/ValuesOnArray.pm b/lib/Syntax/Feature/ValuesOnArray.pm > index 50f2860..e9677f3 100644 > --- a/lib/Syntax/Feature/ValuesOnArray.pm > +++ b/lib/Syntax/Feature/ValuesOnArray.pm > @@ -31,7 +31,7 @@ sub install {
Show quoted text
> return unless $^V lt 5.12.0; > no strict 'refs'; > - *{"$args{into}::values"} = \&avalues; > + *{"$args{into}::values"} = \&Tie::ArrayAsHash::avalues; > }
Show quoted text
> # XXX on uninstall, delete symbol
Show quoted text
> --------------------------------------------------------------------------