blob: c2f7b43fb32b95fed585735fbb9a4789d3170848 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#!./perl
# 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''
}
|