summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes5
-rw-r--r--META.json6
-rw-r--r--META.yml6
-rw-r--r--README2
-rw-r--r--debian/changelog9
-rw-r--r--debian/control31
-rw-r--r--lib/Var/Pairs.pm12
-rw-r--r--t/autobox.t2
-rw-r--r--t/hash.t2
-rw-r--r--t/hash_while.t4
-rw-r--r--t/hash_while_kv.t4
-rw-r--r--t/hashref.t2
12 files changed, 50 insertions, 35 deletions
diff --git a/Changes b/Changes
index 0acfeed..1aa7dae 100644
--- a/Changes
+++ b/Changes
@@ -149,3 +149,8 @@ Revision history for Var-Pairs
0.004001 Wed May 9 18:01:58 2018
POD fix (thanks, Salvatore)
+
+
+0.004002 Tue Jul 4 21:52:33 2023
+
+ * Removed all given/when and smartmatching for compatibility with Perl 5.38+
diff --git a/META.json b/META.json
index 1b15da2..f019c71 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
"Damian Conway <DCONWAY@CPAN.org>"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.142690",
+ "generated_by" : "ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
@@ -32,7 +32,6 @@
},
"runtime" : {
"requires" : {
- "Data::Alias" : "1.16",
"Devel::Callsite" : "0.06",
"PadWalker" : "1.93",
"Scope::Upper" : "0",
@@ -42,5 +41,6 @@
}
},
"release_status" : "stable",
- "version" : "0.004001"
+ "version" : "0.004002",
+ "x_serialization_backend" : "JSON::PP version 4.10"
}
diff --git a/META.yml b/META.yml
index 2454018..5ded142 100644
--- a/META.yml
+++ b/META.yml
@@ -7,7 +7,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.142690'
+generated_by: 'ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -18,10 +18,10 @@ no_index:
- t
- inc
requires:
- Data::Alias: '1.16'
Devel::Callsite: '0.06'
PadWalker: '1.93'
Scope::Upper: '0'
Test::More: '0'
experimental: '0'
-version: '0.004001'
+version: '0.004002'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/README b/README
index 54dc816..f364f7d 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Var::Pairs version 0.004001
+Var::Pairs version 0.004002
This module exports a small number of subroutines that
add some Perl 6 conveniences to Perl 5. Specifically,
diff --git a/debian/changelog b/debian/changelog
index 83d80ed..4b0606d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+libvar-pairs-perl (0.004002-1) unstable; urgency=medium
+
+ * Team upload.
+ * Import upstream version 0.004002.
+ * Declare compliance with Debian Policy 4.6.2.
+ * Bump debhelper-compat to 13.
+
+ -- Étienne Mollier <emollier@debian.org> Fri, 21 Jul 2023 20:13:44 +0200
+
libvar-pairs-perl (0.004001-2) unstable; urgency=medium
[ gregor herrmann ]
diff --git a/debian/control b/debian/control
index 40c9adf..2a47390 100644
--- a/debian/control
+++ b/debian/control
@@ -1,29 +1,30 @@
Source: libvar-pairs-perl
-Section: perl
-Priority: optional
Maintainer: Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>
Uploaders: Salvatore Bonaccorso <carnil@debian.org>
-Build-Depends: debhelper-compat (= 12)
+Section: perl
+Testsuite: autopkgtest-pkg-perl
+Priority: optional
+Build-Depends: debhelper-compat (= 13)
Build-Depends-Indep: libautobox-perl,
- libdevel-callsite-perl,
- libpadwalker-perl,
- libscope-upper-perl,
- perl | libdata-alias-perl,
- perl
-Standards-Version: 4.1.5
+ libdevel-callsite-perl,
+ libpadwalker-perl,
+ libscope-upper-perl,
+ perl,
+ perl | libdata-alias-perl
+Standards-Version: 4.6.2
Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libvar-pairs-perl
Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libvar-pairs-perl.git
Homepage: https://metacpan.org/release/Var-Pairs
-Testsuite: autopkgtest-pkg-perl
Rules-Requires-Root: no
Package: libvar-pairs-perl
Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends},
- libdevel-callsite-perl,
- libpadwalker-perl,
- libscope-upper-perl,
- perl | libdata-alias-perl
+Depends: ${misc:Depends},
+ ${perl:Depends},
+ libdevel-callsite-perl,
+ libpadwalker-perl,
+ libscope-upper-perl,
+ perl | libdata-alias-perl
Recommends: libautobox-perl
Description: Perl module implementing iterators and pair constructors for variables
Var::Pairs exports a small number of subroutines that add some Perl 6
diff --git a/lib/Var/Pairs.pm b/lib/Var/Pairs.pm
index 3d78500..b0cf0cc 100644
--- a/lib/Var/Pairs.pm
+++ b/lib/Var/Pairs.pm
@@ -1,7 +1,7 @@
package Var::Pairs;
use 5.014;
-our $VERSION = '0.004001';
+our $VERSION = '0.004002';
use warnings;
no if $] >= 5.018, warnings => "experimental::smartmatch";
@@ -247,8 +247,8 @@ sub _invert {
croak 'Invalid call to invert() in scalar context';
}
- given (ref($var_ref) || 'SCALAR') {
- when ('HASH') {
+ for my $var_type (ref($var_ref) || 'SCALAR') {
+ if ($var_type eq 'HASH') {
for my $key (keys %{$var_ref}) {
my $values = $var_ref->{$key};
for my $value ( ref $values eq 'ARRAY' ? @$values : $values ) {
@@ -257,7 +257,7 @@ sub _invert {
}
}
}
- when ('ARRAY') {
+ elsif ($var_type eq 'ARRAY') {
for my $key (0..$#{$var_ref}) {
my $values = $var_ref->[$key];
for my $value ( ref $values eq 'ARRAY' ? @$values : $values ) {
@@ -266,7 +266,7 @@ sub _invert {
}
}
}
- default {
+ else {
croak "Argument to invert() must be hash or array (not \L$_\E)";
}
}
@@ -329,7 +329,7 @@ Var::Pairs - OO iterators and pair constructors for variables
=head1 VERSION
-This document describes Var::Pairs version 0.004001
+This document describes Var::Pairs version 0.004002
=head1 SYNOPSIS
diff --git a/t/autobox.t b/t/autobox.t
index acc11f3..f5659ae 100644
--- a/t/autobox.t
+++ b/t/autobox.t
@@ -22,7 +22,7 @@ my $data_ref = {};
@{$data_ref}{1..6} = ('a'..'f');
while (my $next = $data_ref->each_pair) {
- ok $next->key ~~ $data_ref => 'key method correct';
+ ok exists $data_ref->{$next->key} => 'key method correct';
ok $next->value eq $data_ref->{$next->key} => 'value method correct';
delete $data_ref->{$next->key};
}
diff --git a/t/hash.t b/t/hash.t
index 93393f8..15ba6e6 100644
--- a/t/hash.t
+++ b/t/hash.t
@@ -9,7 +9,7 @@ my %data;
@data{1..6} = ('a'..'f');
for my $next (pairs %data) {
- ok $next->key ~~ %data => 'key method correct';
+ ok exists $data{ $next->key } => 'key method correct';
ok $next->value eq $data{$next->key} => 'value method correct';
delete $data{$next->key};
}
diff --git a/t/hash_while.t b/t/hash_while.t
index 228c447..e2562e5 100644
--- a/t/hash_while.t
+++ b/t/hash_while.t
@@ -9,8 +9,8 @@ my %data;
@data{1..6} = ('a'..'f');
while (my $next = each_pair %data) {
- ok $next->key ~~ %data => 'key method correct';
- ok $next->value eq $data{$next->key} => 'value method correct';
+ ok exists $data{ $next->key } => 'key method correct';
+ ok $next->value eq $data{$next->key} => 'value method correct';
delete $data{$next->key};
}
diff --git a/t/hash_while_kv.t b/t/hash_while_kv.t
index 020560f..58fa618 100644
--- a/t/hash_while_kv.t
+++ b/t/hash_while_kv.t
@@ -10,8 +10,8 @@ my %data;
while (my $next = each_pair %data) {
my ($key, $value) = $next->kv;
- ok $key ~~ %data => 'key method correct';
- ok $value eq $data{$key} => 'value method correct';
+ ok exists $data{ $key } => 'key method correct';
+ ok $value eq $data{$key} => 'value method correct';
delete $data{$key};
}
diff --git a/t/hashref.t b/t/hashref.t
index 3ed6e5a..29e970c 100644
--- a/t/hashref.t
+++ b/t/hashref.t
@@ -10,7 +10,7 @@ my $data_ref = {};
my @keys = keys %{$data_ref};
for my $next (pairs $data_ref) {
- ok $next->key ~~ $data_ref => 'key method correct';
+ ok exists $data_ref->{$next->key} => 'key method correct';
ok $next->value eq $data_ref->{$next->key} => 'value method correct';
delete $data_ref->{$next->key};
}