--- lib/Class/MOP/Class.pm +++ lib/Class/MOP/Class.pm @@ -15,7 +15,7 @@ use Module::Runtime 'use_package_optimis use Scalar::Util 'blessed'; use Sub::Util 1.40 'set_subname'; use Try::Tiny; -use List::Util 1.33 'all'; +use List::MoreUtils 'all'; use parent 'Class::MOP::Module', 'Class::MOP::Mixin::HasAttributes', --- lib/Moose/Exporter.pm +++ lib/Moose/Exporter.pm @@ -6,7 +6,7 @@ use warnings; use Class::Load qw(is_class_loaded); use Class::MOP; -use List::Util 1.45 qw( uniq ); +use List::MoreUtils qw( uniq ); use Moose::Util::MetaRole; use Scalar::Util 1.40 qw(reftype); use Sub::Exporter 0.980; --- lib/Moose/Meta/Attribute.pm +++ lib/Moose/Meta/Attribute.pm @@ -5,7 +5,7 @@ our $VERSION = '2.2200'; use B (); use Scalar::Util 'blessed'; -use List::Util 1.33 'any'; +use List::MoreUtils 'any'; use Try::Tiny; use overload (); --- lib/Moose/Meta/Class.pm +++ lib/Moose/Meta/Class.pm @@ -6,7 +6,7 @@ use warnings; use Class::MOP; use Data::OptList; -use List::Util 1.33 qw( any ); +use List::MoreUtils qw( any ); use Scalar::Util 'blessed'; use Moose::Meta::Method::Overridden; --- lib/Moose/Meta/Method/Accessor/Native/Array/uniq.pm +++ lib/Moose/Meta/Method/Accessor/Native/Array/uniq.pm @@ -4,7 +4,7 @@ our $VERSION = '2.2200'; use strict; use warnings; -use List::Util 1.45 (); +use List::MoreUtils (); use Moose::Role; @@ -16,7 +16,7 @@ sub _return_value { my $self = shift; my ($slot_access) = @_; - return 'List::Util::uniq @{ (' . $slot_access . ') }'; + return 'List::MoreUtils::uniq @{ (' . $slot_access . ') }'; } no Moose::Role; --- lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm +++ lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm @@ -4,7 +4,7 @@ our $VERSION = '2.2200'; use strict; use warnings; -use List::Util 1.32; +use List::MoreUtils; use Moose::Role; with 'Moose::Meta::Method::Accessor::Native::Hash::Writer'; @@ -65,7 +65,11 @@ sub _inline_coerce_new_values { # Is there a simpler way to do this? return ( - '@_ = List::Util::pairmap { $a => $member_coercion->($b) } @_;', + 'my $iter = List::MoreUtils::natatime(2, @_);', + '@_ = ();', + 'while (my ($key, $val) = $iter->()) {', + 'push @_, $key, $member_coercion->($val);', + '}', ); }; --- lib/Moose/Meta/Method/Accessor/Native/Writer.pm +++ lib/Moose/Meta/Method/Accessor/Native/Writer.pm @@ -4,7 +4,7 @@ our $VERSION = '2.2200'; use strict; use warnings; -use List::Util 1.33 qw( any ); +use List::MoreUtils qw( any ); use Moose::Util; use Moose::Role; --- lib/Moose/Meta/Role/Application.pm +++ lib/Moose/Meta/Role/Application.pm @@ -6,7 +6,7 @@ use warnings; use metaclass; use overload (); -use List::Util 1.33 qw( all ); +use List::MoreUtils qw( all ); use Moose::Util 'throw_exception'; --- lib/Moose/Meta/Role/Application/RoleSummation.pm +++ lib/Moose/Meta/Role/Application/RoleSummation.pm @@ -5,7 +5,7 @@ use strict; use warnings; use metaclass; -use List::Util 1.33 qw( all ); +use List::MoreUtils qw( all ); use Scalar::Util 'blessed'; use Moose::Meta::Role::Composite; --- lib/Moose/Meta/Role/Application/ToInstance.pm +++ lib/Moose/Meta/Role/Application/ToInstance.pm @@ -6,7 +6,7 @@ use warnings; use metaclass; use Scalar::Util 'blessed'; -use List::Util 1.33 'all'; +use List::MoreUtils 'all'; use Devel::OverloadInfo 0.004 'is_overloaded'; use parent 'Moose::Meta::Role::Application'; --- lib/Moose/Meta/Role/Attribute.pm +++ lib/Moose/Meta/Role/Attribute.pm @@ -4,7 +4,7 @@ our $VERSION = '2.2200'; use strict; use warnings; -use List::Util 1.33 'all'; +use List::MoreUtils 'all'; use Scalar::Util 'blessed', 'weaken'; use parent 'Moose::Meta::Mixin::AttributeCore', 'Class::MOP::Object'; --- lib/Moose/Meta/TypeConstraint/DuckType.pm +++ lib/Moose/Meta/TypeConstraint/DuckType.pm @@ -7,7 +7,7 @@ use metaclass; use B; use Scalar::Util 'blessed'; -use List::Util 1.33 qw(all); +use List::MoreUtils qw(all); use Moose::Util 'english_list'; use Moose::Util::TypeConstraints (); @@ -26,7 +26,7 @@ my $inliner = sub { return $self->parent->_inline_check($val) . ' && do {' . "\n" . 'my $val = ' . $val . ';' . "\n" - . '&List::Util::all(' . "\n" + . '&List::MoreUtils::all(' . "\n" . 'sub { $val->can($_) },' . "\n" . join(', ', map { B::perlstring($_) } @{ $self->methods }) . ');' . "\n" --- lib/Moose/Meta/TypeConstraint/Union.pm +++ lib/Moose/Meta/TypeConstraint/Union.pm @@ -7,7 +7,8 @@ use metaclass; use Moose::Meta::TypeCoercion::Union; -use List::Util 1.33 qw(first all); +use List::MoreUtils qw(all); +use List::Util qw(first); use parent 'Moose::Meta::TypeConstraint'; --- lib/Moose/Util/MetaRole.pm +++ lib/Moose/Util/MetaRole.pm @@ -5,7 +5,8 @@ use strict; use warnings; use Scalar::Util 'blessed'; -use List::Util 1.33 qw( first all ); +use List::MoreUtils qw( all ); +use List::Util qw( first ); use Moose::Deprecated; use Moose::Util 'throw_exception'; --- lib/Moose/Util.pm +++ lib/Moose/Util.pm @@ -8,7 +8,8 @@ use Module::Runtime 0.014 'use_package_o use Data::OptList; use Sub::Exporter; use Scalar::Util 'blessed'; -use List::Util 1.33 qw(first any all); +use List::Util qw(first); +use List::MoreUtils qw(any all); use overload (); use Try::Tiny; --- lib/Moose/Util/TypeConstraints/Builtins.pm +++ lib/Moose/Util/TypeConstraints/Builtins.pm @@ -5,7 +5,7 @@ use strict; use warnings; use Class::Load qw( is_class_loaded ); -use List::Util 1.33 (); +use List::MoreUtils (); use Scalar::Util qw( blessed ); sub type { goto &Moose::Util::TypeConstraints::type } @@ -223,7 +223,7 @@ sub define_builtins { 'do {' . 'my $check = ' . $val . ';' . 'ref($check) eq "ARRAY" ' - . '&& &List::Util::all(' + . '&& &List::MoreUtils::all(' . 'sub { ' . $type_parameter->_inline_check('$_') . ' }, ' . '@{$check}' . ')' @@ -258,7 +258,7 @@ sub define_builtins { 'do {' . 'my $check = ' . $val . ';' . 'ref($check) eq "HASH" ' - . '&& &List::Util::all(' + . '&& &List::MoreUtils::all(' . 'sub { ' . $type_parameter->_inline_check('$_') . ' }, ' . 'values %{$check}' . ')' --- lib/Test/Moose.pm +++ lib/Test/Moose.pm @@ -7,7 +7,7 @@ use warnings; use Sub::Exporter; use Test::Builder; -use List::Util 1.33 'all'; +use List::MoreUtils 'all'; use Moose::Util 'does_role', 'find_meta'; my @exports = qw[ --- Makefile.PL +++ Makefile.PL @@ -39,7 +39,8 @@ my %WriteMakefileArgs = ( "Devel::StackTrace" => "2.03", "Dist::CheckConflicts" => "0.02", "Eval::Closure" => "0.04", - "List::Util" => "1.56", + "List::MoreUtils" => "0.28", + "List::Util" => "0", "MRO::Compat" => "0.05", "Module::Runtime" => "0.014", "Module::Runtime::Conflicts" => "0.002", @@ -103,7 +104,8 @@ my %FallbackPrereqs = ( "Dist::CheckConflicts" => "0.02", "Eval::Closure" => "0.04", "File::Spec" => 0, - "List::Util" => "1.56", + "List::MoreUtils" => "0.28", + "List::Util" => "0", "MRO::Compat" => "0.05", "Module::Metadata" => 0, "Module::Runtime" => "0.014", --- META.json +++ META.json @@ -162,7 +162,8 @@ "File::Find::Rule" : "0", "File::pushd" : "0", "IPC::System::Simple" : "0", - "List::Util" : "1.56", + "List::MoreUtils" : "0.28", + "List::Util" : "0", "MRO::Compat" : "0.05", "Module::Runtime" : "0.014", "Module::Runtime::Conflicts" : "0.002", @@ -202,7 +203,8 @@ "Devel::StackTrace" : "2.03", "Dist::CheckConflicts" : "0.02", "Eval::Closure" : "0.04", - "List::Util" : "1.56", + "List::MoreUtils" : "0.28", + "List::Util" : "0", "MRO::Compat" : "0.05", "Module::Runtime" : "0.014", "Module::Runtime::Conflicts" : "0.002", --- t/00-report-prereqs.dd +++ t/00-report-prereqs.dd @@ -130,7 +130,8 @@ do { my $x = { 'File::Find::Rule' => '0', 'File::pushd' => '0', 'IPC::System::Simple' => '0', - 'List::Util' => '1.56', + 'List::MoreUtils' => '0.28', + 'List::Util' => '0', 'MRO::Compat' => '0.05', 'Module::Runtime' => '0.014', 'Module::Runtime::Conflicts' => '0.002', @@ -170,7 +171,8 @@ do { my $x = { 'Devel::StackTrace' => '2.03', 'Dist::CheckConflicts' => '0.02', 'Eval::Closure' => '0.04', - 'List::Util' => '1.56', + 'List::MoreUtils' => '0.28', + 'List::Util' => '0', 'MRO::Compat' => '0.05', 'Module::Runtime' => '0.014', 'Module::Runtime::Conflicts' => '0.002', @@ -209,4 +211,4 @@ do { my $x = { } }; $x; - } \ No newline at end of file + } --- t/recipes/basics_genome_overloadingsubtypesandcoercion.t +++ t/recipes/basics_genome_overloadingsubtypesandcoercion.t @@ -42,12 +42,12 @@ use Test::More; ); } - use List::Util 1.56 qw( mesh ); + use List::MoreUtils qw( mesh ); coerce 'Human::EyeColor' => from 'ArrayRef' => via { my @genes = qw( bey2_1 bey2_2 gey_1 gey_2 ); - return Human::EyeColor->new( mesh( \@genes, $_ ) ); }; + return Human::EyeColor->new( mesh( @genes, @{$_} ) ); }; has 'eye_color' => ( is => 'ro', --- t/type_constraints/inlining.t +++ t/type_constraints/inlining.t @@ -4,7 +4,7 @@ use warnings; use Test::Fatal; use Test::More; -use List::Util 1.33 (); +use List::MoreUtils (); use Moose::Util::TypeConstraints; #<<< @@ -56,7 +56,7 @@ my $not_inlinable = find_type_constraint is( $aofi->_inline_check('$foo'), - q{( do { do {my $check = $foo;ref($check) eq "ARRAY" && &List::Util::all(sub { ( do { defined $_ && ! ref $_ && $_ !~ /Q/ } ) }, @{$check})} } )}, + q{( do { do {my $check = $foo;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { ( do { defined $_ && ! ref $_ && $_ !~ /Q/ } ) }, @{$check})} } )}, 'got expected inline code for ArrayRef[Inlinable] constraint' ); @@ -85,7 +85,7 @@ subtype 'ArrayOfNotInlinable', is( $aofi->_inline_check('$foo'), - q{( do { do {my $check = $foo;ref($check) eq "ARRAY" && &List::Util::all(sub { ( do { defined $_ && ! ref $_ && $_ !~ /Q/ } ) }, @{$check})} } )}, + q{( do { do {my $check = $foo;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { ( do { defined $_ && ! ref $_ && $_ !~ /Q/ } ) }, @{$check})} } )}, 'got expected inline code for ArrayOfInlinable constraint' ); @@ -109,7 +109,7 @@ subtype 'ArrayOfNotInlinable', is( $hoaofi->_inline_check('$foo'), - q{( do { do {my $check = $foo;ref($check) eq "HASH" && &List::Util::all(sub { ( do { do {my $check = $_;ref($check) eq "ARRAY" && &List::Util::all(sub { ( do { defined $_ && ! ref $_ && $_ !~ /Q/ } ) }, @{$check})} } ) }, values %{$check})} } )}, + q{( do { do {my $check = $foo;ref($check) eq "HASH" && &List::MoreUtils::all(sub { ( do { do {my $check = $_;ref($check) eq "ARRAY" && &List::MoreUtils::all(sub { ( do { defined $_ && ! ref $_ && $_ !~ /Q/ } ) }, @{$check})} } ) }, values %{$check})} } )}, 'got expected inline code for HashRef[ArrayRef[Inlinable]] constraint' ); --- xt/author/test-my-dependents.t +++ xt/author/test-my-dependents.t @@ -37,7 +37,7 @@ use Test::Requires { use Test::DependentModules qw( test_module ); use DateTime; -use List::Util 1.33 qw(any); +use List::MoreUtils qw(any); use Moose (); diag( 'Test run performed at: '