annotate _test/object.t @ 0:03e58a454b20

Создан репозитарий
author Sergey
date Tue, 14 Jul 2009 12:54:37 +0400
parents
children 78cd38551534
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
1 #!/usr/bin/perl -w
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
2 use strict;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
3 use lib '../Lib';
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
4
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
5 package Foo;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
6 use base qw(IMPL::Object);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
7
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
8 sub CTOR {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
9 my ($this,%args) = @_;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
10 print "CTOR Foo $args{Name}\n";
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
11 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
12
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
13 sub Hello {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
14 print "Hello";
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
15 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
16
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
17 package Bar;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
18 use base qw(Foo);
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
19
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
20 __PACKAGE__->PassThroughArgs;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
21
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
22 sub CTOR {
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
23 print "CTOR Bar\n";
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
24 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
25
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
26 package main;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
27
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
28 my $obj = new Bar ( Name => 'Tom') ;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
29
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
30 Hello $obj;
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
31
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
32 no strict 'refs';
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
33 print "$_\n" foreach sort keys %{'Bar::'};