Test-Ranger
view release on metacpan or search on metacpan
lib/Test/Ranger.pm view on Meta::CPAN
464748495051525354555657585960616263646566# If invoked with $class and an arrayref, invokes ::List::new().
#
sub
new {
my
$class
=
shift
;
my
$self
=
shift
|| {};
# default: hashref
if
( (reftype
$self
)->array ) {
$self
= Test::Ranger::List->new(
$self
);
}
else
{
bless
(
$self
=>
$class
);
$self
->init();
};
return
$self
;
};
## new
#=========# OBJECT METHOD
#
# $obj->init();
#
lib/Test/Ranger/List.pm view on Meta::CPAN
293031323334353637383940414243444546474849# But it is constructed by passing in an arrayref.
# An empty hashref is blessed into $class.
# Each element of @list is blessed into Test::Ranger in init().
# Housekeeping info for the whole object is stored in other keys.
#
sub
new {
my
$class
=
shift
;
my
@list
= @{
shift
() };
my
$self
= {};
bless
(
$self
=>
$class
);
$self
->init(
@list
);
return
$self
;
};
## new
#=========# OBJECT METHOD
#
# $self->init( @list );
#
# Purpose : Object initializer
( run in 1.455 second using v1.01-cache-2.11-cpan-94b05bcf43c )