in reply to Re: It is not an array!
in thread It is not an array!
This was the constructor:
sub new { my ($class, %parameters) = \@_; my $self = bless ({}, ref ($class) || $class); return ($self); }
This came right out of ExtUtils::ModuleMaker. After reading some of the comments in this node, I flipped through the Camel and found this suggestion:
sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { }; bless($self, $class); return $self; }
Which appears to me to do basically the same thing (except it's not taking a hashref as a param, which shouldn't matter, and I don't need it anyway). However, the tests all pass with this version.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: It is not an array!
by premchai21 (Curate) on Nov 19, 2002 at 01:51 UTC |