Dermot wrote:
I created a small Class, initially with Moose. When I wanted an
instance of the class I would call `my $instance = new MyClass`;
I then removed Moose and went for a standard Perl 00 constructor:
sub new {
my $class = shift;
my $self = {};
$self->{config} = _get_config();
bless ($self, $class);
return $self;
}
I haven't changed the way I created an instance, and it still works. I
would have thought I would have to create instances now with
my $instance = MyClass->new;
Are both assignments legit?
There is even a third way:
MyClass::->new
and a fourth way:
MyClass::->new()
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/