diff options
author | Larry Wall <larry@netlabs.com> | 1994-03-18 00:00:00 +0000 |
---|---|---|
committer | Larry Wall <larry@netlabs.com> | 1994-03-18 00:00:00 +0000 |
commit | 8990e3071044a96302560bbdb5706f3e74cf1bef (patch) | |
tree | 6cf4a58108544204591f25bd2d4f1801d49334b4 /foo | |
parent | ed6116ce9b9d13712ea252ee248b0400653db7f9 (diff) | |
download | perl-8990e3071044a96302560bbdb5706f3e74cf1bef.tar.gz |
perl 5.0 alpha 6
[editor's note: cleaned up from the September '94 InfoMagic CD, just
like the last commit]
Diffstat (limited to 'foo')
-rwxr-xr-x | foo | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -1,12 +1,11 @@ #!./perl -tie ( @a, TST_tie, "arg1", "arg2" ); -$a[2]=[1]; - -package TST_tie; - -sub new { bless []; } - -sub fetch { print "store @_\n" } -sub store { print "store @_\n" } -sub delete { print "store @_\n" } +# Multiple Inheritence (get rich quick :-) + { + package OBJ2; sub abc { print "abc\n"; } + package OBJ3; sub def { print "def\n"; } + package OBJ4; @ISA = ("OBJ2", "OBJ3"); + $x = bless { foo => bar }; + $x->abc; # prints ``abc'' + $x->def; # prints ``def'' + } |