Yes... I've used singleton producing functions before but what's the point in that? If I say that DB->handle() returns the DBI handle or put the thing in $DB::handle, how does that differ? Consider that your function itself is a global of a kind. It is nameable by any code elsewhere in the running program just as your variable slot was.
Anyhow, Factories are for Java programmers. That's what our untyped variables are for in perl and that's an entirely different discussion.
In reply to Re^7: Wassercrats::Improved Volume 0, Number 0
by diotalevi
in thread Perl::Improved Volume 0, Number 0
by Wassercrats
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |