use strict; use warnings; BEGIN { package MyPackage; use overload '""' => \&to_string; sub new { my $this = shift; my $class = ref($this) || $this; return bless {}, $class; } sub to_string { my ($self) = @_; return "ook?"; } } my $object = MyPackage->new(); print($object, "\n"); # ook?
In reply to Re: Anonymous Autoloading with OOP?
by ikegami
in thread Anonymous Autoloading with OOP?
by AlphaWolf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |