annotate _test/temp.pl @ 419:bbc4739c4d48 ref20150831

working on IMPL::Config::Container
author cin
date Sun, 29 Jan 2017 10:30:20 +0300
parents 3f38dabaf5cc
children b0481c071bea
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;
412
30e8c6a74937 working on di container (role based registrations)
cin
parents: 411
diff changeset
3 use Carp;
30e8c6a74937 working on di container (role based registrations)
cin
parents: 411
diff changeset
4 use Time::HiRes qw(gettimeofday tv_interval);
415
3d24b10dd0d5 working on IMPL::Config::Container
cin
parents: 414
diff changeset
5 use Scalar::Util qw(blessed refaddr);
418
cin
parents: 417
diff changeset
6 use YAML::XS qw(Dump Load);
407
c6e90e02dd17 renamed Lib->lib
cin
parents: 406
diff changeset
7
418
cin
parents: 417
diff changeset
8
417
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
9
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
10 use IMPL::require {
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
11 Container => 'IMPL::Config::Container',
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
12 Service => 'IMPL::Config::ServiceDescriptor',
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
13 Reference => 'IMPL::Config::ReferenceDescriptor',
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
14 Value => 'IMPL::Config::ValueDescriptor'
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
15 };
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
16
418
cin
parents: 417
diff changeset
17 my $data;
cin
parents: 417
diff changeset
18 {
419
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
19 open my $h, "<", "sample.yaml" or die;
bbc4739c4d48 working on IMPL::Config::Container
cin
parents: 418
diff changeset
20 print "H: ", *{$h}{IO}, "\n";
418
cin
parents: 417
diff changeset
21 binmode $h;
cin
parents: 417
diff changeset
22 local $/;
cin
parents: 417
diff changeset
23 $data = <$h>;
cin
parents: 417
diff changeset
24 }
417
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
25
418
cin
parents: 417
diff changeset
26 my $t = [gettimeofday];
417
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
27
418
cin
parents: 417
diff changeset
28 print Dump Load($data);
417
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
29
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
30 print "Activated: ",tv_interval($t,[gettimeofday]),"\n";
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
31
3ed0c58e9da3 working on di container, tests
cin
parents: 415
diff changeset
32
407
c6e90e02dd17 renamed Lib->lib
cin
parents: 406
diff changeset
33 1;