Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Override new in Moose for flyweight objects

by tobyink (Canon)
on Apr 07, 2020 at 20:45 UTC ( [id://11115192]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %obj_cache;
    
    ...
        my $params = $class->BUILDARGS(@args);
        $obj_cache{$params->{thingy}} ||= $class->_new($params);
    };
    
  2. or download this
    sub instance { shift->new(@_) }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11115192]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-23 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found