Mercurial > pub > Impl
diff _test/temp.pl @ 414:ec6f2d389d1e ref20150831
working on IMPL::Config::Bag
author | cin |
---|---|
date | Fri, 02 Oct 2015 06:56:24 +0300 |
parents | 30e8c6a74937 |
children | 3d24b10dd0d5 |
line wrap: on
line diff
--- a/_test/temp.pl Thu Sep 24 12:19:30 2015 +0300 +++ b/_test/temp.pl Fri Oct 02 06:56:24 2015 +0300 @@ -3,46 +3,9 @@ use Carp; use Time::HiRes qw(gettimeofday tv_interval); use Scalar::Util qw(blessed); -my $slot; -my $ref = bless \$slot, 'Wrapper'; -sub is { - my $slot = shift; - bless \$slot, 'Wrapper'; -} - -sub instanceOf { - carp "A typename can't be undefined" unless $_[1]; - blessed($_[0]) and $_[0]->isa($_[1]) -} - -my $bar = Bar->new(); - -my $t = [gettimeofday]; - -for(my $i =0; $i< 1000000; $i++) { - is($bar)->instanceOf('Bar'); -} -print "Is: ",tv_interval($t,[gettimeofday]),"\n"; - -$t = [gettimeofday]; - -for(my $i =0; $i< 1000000; $i++) { - instanceOf($bar, 'Bar'); -} - -print "Is: ",tv_interval($t,[gettimeofday]),"\n"; - +my $data = [1,2,3]; -package Wrapper; -use Scalar::Util qw(blessed); -sub instanceOf { - blessed(${$_[0]}) and ${$_[0]}->isa($_[1]); -} - -package Bar; -use IMPL::declare { - base => ['IMPL::Object' => undef] -}; +print foreach @$data, 4; 1;