I'm reading through perltoot(1), trying to grok perl's way of doing OO, and it actually recommends doing just what Theseus did. From perltoot:
sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = {}; $self->{NAME} = undef; $self->{AGE} = undef; $self->{PEERS} = []; bless ($self, $class); return $self; }
So is this only recommended if you plan to allow for inheritance? Or did I miss something?
-Dan
In reply to Re: (jeffa) 3Re: My first stab at OO perl...
by v_thunder
in thread My first stab at OO perl...
by Theseus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |