annotate _test/temp.pl @ 426:eed50c01e758 ref20150831

Split off the core module, added Dist-Zilla config
author cin
date Tue, 15 May 2018 00:51:01 +0300
parents 87af445663d7
children 09e0086a82a7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
210
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
1 #!/usr/bin/perl
6adaeb86945d added IMPL::Web::AutoLocator
sergey
parents: 209
diff changeset
2 use strict;
423
60c2892a577c working on base class system
cin
parents: 422
diff changeset
3 use v5.10;
412
30e8c6a74937 working on di container (role based registrations)
cin
parents: 411
diff changeset
4 use Carp;
30e8c6a74937 working on di container (role based registrations)
cin
parents: 411
diff changeset
5 use Time::HiRes qw(gettimeofday tv_interval);
415
3d24b10dd0d5 working on IMPL::Config::Container
cin
parents: 414
diff changeset
6 use Scalar::Util qw(blessed refaddr);
418
cin
parents: 417
diff changeset
7 use YAML::XS qw(Dump Load);
422
b0481c071bea IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents: 419
diff changeset
8 use Data::Dumper;
b0481c071bea IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents: 419
diff changeset
9 use URI;
418
cin
parents: 417
diff changeset
10
424
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
11 package Bar;
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
12 use base qw(IMPL::Object);
423
60c2892a577c working on base class system
cin
parents: 422
diff changeset
13
424
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
14 sub CTOR {
423
60c2892a577c working on base class system
cin
parents: 422
diff changeset
15 }
417
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
16
424
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
17 package Bar2;
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
18 use base qw(Bar);
423
60c2892a577c working on base class system
cin
parents: 422
diff changeset
19
60c2892a577c working on base class system
cin
parents: 422
diff changeset
20 sub CTOR {
60c2892a577c working on base class system
cin
parents: 422
diff changeset
21 }
417
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
22
423
60c2892a577c working on base class system
cin
parents: 422
diff changeset
23 package Foo;
424
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
24 use base qw(IMPL::Object::_Base);
417
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
25
424
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
26 sub new {
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
27 my $instance = bless {}, shift;
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
28 $instance->__construct();
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
29 return $instance;
423
60c2892a577c working on base class system
cin
parents: 422
diff changeset
30 }
60c2892a577c working on base class system
cin
parents: 422
diff changeset
31
60c2892a577c working on base class system
cin
parents: 422
diff changeset
32 sub CTOR {
60c2892a577c working on base class system
cin
parents: 422
diff changeset
33 }
60c2892a577c working on base class system
cin
parents: 422
diff changeset
34
424
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
35 package Foo2;
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
36 use base qw(Foo);
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
37
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
38 sub CTOR {
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
39
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
40 }
423
60c2892a577c working on base class system
cin
parents: 422
diff changeset
41
424
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
42 package main;
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
43
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
44 my $t = [gettimeofday];
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
45
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
46 for(my $i=0; $i <1000000; $i++) {
426
eed50c01e758 Split off the core module, added Dist-Zilla config
cin
parents: 424
diff changeset
47 my $v = new Foo2;
423
60c2892a577c working on base class system
cin
parents: 422
diff changeset
48 }
60c2892a577c working on base class system
cin
parents: 422
diff changeset
49
424
87af445663d7 IMPL::Object::_Base
cin
parents: 423
diff changeset
50 say tv_interval($t);
422
b0481c071bea IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents: 419
diff changeset
51
407
c6e90e02dd17 renamed Lib->lib
cin
parents: 406
diff changeset
52 1;