Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^2: OO best practice basic questionsby Amblikai (Scribe) |
on Aug 28, 2014 at 10:09 UTC ( [id://1098845]=note: print w/replies, xml ) | Need Help?? |
Thanks, i've added the uneven list test into my constructor. When using the obj_count, is there a way to make it a method of the object? I don't know if that makes sense but in order to call it i guess i have to use Numbers::get_count() for example. But then if i attach it to each object i'm guessing the object will only have the value at that time, so i'd have to be sure to only check the value in the last object created. Is that right? Another question i have is with the value "result" It is an internally created value. So do i initialise the value in the constructor? Or the first time it is used? For example if i call the method add_nums, the result is stored in result. Should that variable already exist? What we be an example of a destructor? Thanks!
In Section
Seekers of Perl Wisdom
|
|