note
dragonchild
NB:
<code>
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
</code>
This allows for children classes to call you as a parent and have the inheritance work. You should NEVER hardcode anything. If you have to do something like <code>bless {}, 'First';</code>, at least do something like <code>bless {}, __PACKAGE__;</code>. That way, if you change the package name, you won't forget to change the name of the package you're blessing this thingy into.
<p>The reason to declare $self first is to allow for you to populate it. :-)
<p>------<br><i>We are the carpenters and bricklayers of the Information Age.</i><p>Don't go borrowing trouble. For programmers, this means <i>Worry only about what you need to implement.</i>
130753
130801