Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Object not created as well with Moose

by rhesa (Vicar)
on Dec 11, 2008 at 12:23 UTC ( #729672=note: print w/ replies, xml ) Need Help??


in reply to Object not created as well with Moose

Wouldn't it make more sense to use default and/or lazy?

has 'CONFIG' => ( is => 'rw', isa => 'Object', lazy => 1, default => sub { Package::System::Config->new }, );
That way you won't need _init().

It would probably be even better to make a subtype for the Config object.


Comment on Re: Object not created as well with Moose
Select or Download Code
Replies are listed 'Best First'.
Re^2: Object not created as well with Moose
by woodpeaker (Novice) on Dec 11, 2008 at 19:33 UTC
    Thanks, your answer helps, but also I found my mistakes))) as always just need to sleep about 6-8 hours, not just 2))) Thanks to all

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2016-02-12 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (402 votes), past polls