given a package with a constructor, is there a way to autoload the object itself to return a given value/subroutine value? i tried something like this:
my goal is that if i $object = MyPackage->new(); then i can do print $objectpackage MyPackgage; sub new { my $this = shift; my $class = ref($this) || $this; my $self = {}; bless $self, $class; return $self; } sub AUTOLOAD { my $self = shift; return "ook?"; }
In reply to Anonymous Autoloading with OOP? by AlphaWolf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |