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

Re: Creating consructor new with empty $self

by pajout (Curate)
on Oct 27, 2010 at 17:48 UTC ( #867805=note: print w/ replies, xml ) Need Help??


in reply to Creating consructor new with empty $self

I think it makes sense. For instance, consider your constructor and following getter/setter method:

sub temperature { my ($self, $t) = @_; if (1 < @_) { $$self{temperature} = $t; } return $$self{temperature}; }

-> I do not see any technical reason for initial filling. Of course, sometimes you really want to initialize it because application logic.


Comment on Re: Creating consructor new with empty $self
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (21)
As of 2014-04-17 15:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (451 votes), past polls