It looks like you've a singleton 'app' and it's been passed around to invoke methods. Normally this sounds like where DI is used? even thought DI would still require you to write $obj->method. Below idea could work. but I'm not really expert in the magical part of Perl. :)
sub _get_instance { ... init singleton if not created yet. return $app; } sub log { # well there should be some easy way to somehow create function that f +orwards to singleton my $app = &_get_instance; $app->log(@_); }
In reply to Re: "importing" methods?
by pwagyi
in thread "importing" methods?
by LanX
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |