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