It's done this way to permit inheritance...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; }
In reply to Re: What does the SHIFT bit do in a constructor
by arhuman
in thread What does the SHIFT bit do in a constructor
by Fian
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |