annotate _test/object.t @ 2:78cd38551534

in develop
author Sergey
date Mon, 10 Aug 2009 17:39:08 +0400
parents 03e58a454b20
children 2e546a5175dd
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) = @_;
2
78cd38551534 in develop
Sergey
parents: 0
diff changeset
10 print "CTOR Foo says $args{Name}\n";
0
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
11 }
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
12
03e58a454b20 Создан репозитарий
Sergey
parents:
diff changeset
13 sub Hello {
2
78cd38551534 in develop
Sergey
parents: 0
diff changeset
14 print "\tHello\n";
0
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
2
78cd38551534 in develop
Sergey
parents: 0
diff changeset
30 Hello $obj;