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