Array-AsHash
view release on metacpan or search on metacpan
lib/Array/AsHash.pm view on Meta::CPAN
757677787980818283848586878889909192939495
}
};
sub
new {
my
$class
=
shift
;
return
$class
->_initialize(
@_
);
}
sub
_initialize {
my
(
$class
,
$arg_ref
) =
@_
;
my
$self
=
bless
{} =>
$class
;
$self
->{array_for} = [];
return
$self
unless
$arg_ref
;
my
$array
=
$arg_ref
->{array} || [];
$self
->{is_strict} =
$arg_ref
->{strict};
$array
= Clone::clone(
$array
)
if
$arg_ref
->{clone};
unless
(
'ARRAY'
eq
ref
$array
) {
$class
->
$_croak
(
'Argument to new() must be an array reference'
);
}
if
(
@$array
% 2 ) {
( run in 0.282 second using v1.01-cache-2.11-cpan-e5176c747c2 )