diff _test/object.t @ 0:03e58a454b20

Создан репозитарий
author Sergey
date Tue, 14 Jul 2009 12:54:37 +0400
parents
children 78cd38551534
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/_test/object.t	Tue Jul 14 12:54:37 2009 +0400
@@ -0,0 +1,33 @@
+#!/usr/bin/perl -w
+use strict;
+use lib '../Lib';
+
+package Foo;
+use base qw(IMPL::Object);
+
+sub CTOR {
+    my ($this,%args) = @_;
+    print "CTOR Foo $args{Name}\n";
+}
+
+sub Hello {
+    print "Hello";
+}
+
+package Bar;
+use base qw(Foo);
+
+__PACKAGE__->PassThroughArgs;
+
+sub CTOR {
+    print "CTOR Bar\n";
+}
+
+package main;
+
+my $obj = new Bar ( Name => 'Tom') ;
+
+Hello $obj;
+
+no strict 'refs';
+print "$_\n" foreach sort keys %{'Bar::'};
\ No newline at end of file