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


in reply to OOP: How to construct multiple instances of a class at once

Moose, of course, has a “getter/setter subroutine” notion, which is very sugar-y.   But you can easily enough do this on your own.   I often define an internal-use-only subroutine, named something like _getBlah (the “_” being my nomenclature for “for internal use only”) which determines if this-or-that information needs to be fetched and if necessary fetches it ... then (in any case) returns $self.   This allows it to be used as a “pass-thru method” in the getter/setter methods, e.g. return $self->_getUserInfo->{'user_name'};.   (Where “$self” is my habitual name for the local variable that refers to “me.”)