Object-Prototype
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Object/Prototype.pm view on Meta::CPAN
my %constructor_of;
my %prototype_of;
sub new($$;$) {
my $class = shift;
my $constructor = shift;
my $self = Storable::dclone($constructor);
my $id = refaddr $self;
$constructor_of{$id} = $constructor;
$prototype_of{$id} = {};
bless $self => $class;
for my $method ( keys %{ $_[0] } ) {
$self->prototype( $method, $_[0]->{$method} );
}
return $self;
}
sub prototype($$;$) {
my $self = shift;
my $id = refaddr $self;
my $method = shift;
view all matches for this distributionview release on metacpan - search on metacpan
( run in 2.402 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )