This piece of code may serve as the base class for objects that need singleton methods (methods specific for this object and not for whole class). One can use it directly
Or, just look at Class::Prototyped, a full-featured, mature (used in production) solution of this. There are likely also some MooseX:: modules that implement prototype-based behavior as well.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.