Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Override new in Moose for flyweight objects

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

Help for this page

Select Code to Download


  1. or download this
    package MyApp {
      use Zydeco;
    ...
    
    my $foo = MyApp::Widget->new( id => 1 );
    my $bar = MyApp->new_widget( id => 2 );   # factory: one character few
    +er!
    
  2. or download this
    package MyApp {
      use Zydeco;
    ...
    my $bar = MyApp->new_widget( id => 42 );
    
    die unless $foo == $bar;
    

Log In?
Username:
Password:

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

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

    No recent polls found