in reply to Object Oriented Programming in Perl.
At this point, it's simple to add another method to get/set/modify your object's individual attributes, or as a whole. You asked for alternative resources on OOP. Honestly, I can't think of anything more rewarding than Chapter 3 of Damian's book. If you haven't sat down and read it in it's entirety, you're performing a disservice to yourself. Quite honestly, it is the bible... I had numerous lightbulbs "go off" before I was done with this chapter. :)sub new { my ($class, $args) = @_; bless { beverage => $args->{beverage} || "Pepsi", entree => $args->{entree} || "soup", dessert => $args->{dessert} || "ice cream", }, $class; }
|
---|