Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Automatic vivification of an object

by Your Mother (Archbishop)
on Jan 14, 2015 at 03:48 UTC ( [id://1113180]=note: print w/replies, xml ) Need Help??


in reply to Automatic vivification of an object

I suggesting reviewing this thread too: Object method prototypes?. Moo/Moose/Mouse all let you defer every aspect of attribute instantiation already and Mouse (and maybe Moo) is likely going to be faster than anything using $AUTOLOAD.

  • Comment on Re: Automatic vivification of an object

Replies are listed 'Best First'.
Re^2: Automatic vivification of an object
by bounsy (Acolyte) on Jan 14, 2015 at 04:25 UTC

    I'm going to have to take a closer look at Moo. It looks like I might be able to use that in the future, since it appears to be pure Perl. (The XS code is what makes Moose unusable currently due to environmental issues that include too many versions of Perl across multiple operating systems.) Unfortunately, Moo's not going to be able to help my current project.

Re^2: Automatic vivification of an object
by bounsy (Acolyte) on Jan 14, 2015 at 04:06 UTC

    I would love to be able to use Moose or something like it, but that's not available to me at my current workplace and is unlikely to be in use any time soon.

    The use of AUTLOAD in this case should involve minimal impact since it only ever calls it once (at most). From then on, it is an object of the correct type.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found