- or download this
package Foo;
...
$self->{val} = $_[0] if @_;
"Bar($self->{val})";
}
- or download this
# Something to mixin
package Printer;
...
my $val = $self->val;
print "Value is $val\n";
}
- or download this
package Foo2;
use vars '@ISA';
...
package Bar2;
use vars '@ISA';
@ISA = qw(Bar Printer);
- or download this
package main;
...
$x->print;
$y->print;