http://www.perlmonks.org?node_id=1208809


in reply to Re^2: Caching a default instance to avoid initializing it every time (with Moo)
in thread Caching a default instance to avoid initializing it every time (with Moo)

You'd still have to write a wrapper if you want a single interface to sometimes provide a new instance, sometimes the singleton. But I like that this interface leaves the choice to the caller, you can either have a new instance, regardless of input, or the singleton when you know it can work.

  • Comment on Re^3: Caching a default instance to avoid initializing it every time (with Moo)