my $t_sub = \&Module::Base::timestamp; my $timestamp = $t_sub->();
No exporting, no pollution, and faster execution than with subs localized through the symbol table. The latter of course is the case only if you don't take a reference to the sub prior to each execution.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: Common sub as method or function
by shmem
in thread Common sub as method or function
by clinton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |