note
przemo
<blockquote><i>Generally, static methods ignore the first argument because they already know which class they are in. new() is implemented by almost all packages as a static method.</i></blockquote>
<p>Yet, because of inheritance and possibility of being called on behalf of other package, well-behaving <c>new()</c> shouldn't ignore the first argument. In simplified case like this:</p>
<c>
sub new {
my ($class, %opts) = @_;
my $self = { %opts };
bless $self, $class;
}
</c>
763019
763021