- or download this
package Foo;
use base 'Exporter';
@EXPORT = "func";
sub func { return "Foo" }
- or download this
package Bar;
use base 'Exporter';
@EXPORT = "func";
sub func { return "Bar" }
- or download this
[matt@blue 478146] cat func.pl
package func;
...
print func();
[matt@blue 478146] perl -l func.pl
Bar
- or download this
[matt@blue 478146] cat meth.pl
package meth;
...
print $o->func;
[matt@blue 478146] perl -l meth.pl
Foo