in reply to Two argument bless syntax
It makes your constructor slightly more flexible. It means that as well as calling it as a class method:
my $foo = SomeClass->new;
You can also call it as an object method:
my $bar = $foo->new;
In general, I'd say that this isn't a good idea. If I want a constructor that can be called as an object method then I'll create a different constructor method with a different (and more meaningful) name - perhaps something like 'clone'.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Syntactic Question
by themage (Friar) on Nov 22, 2006 at 16:27 UTC | |
|
Re^2: Syntactic Question
by doom (Deacon) on Nov 24, 2006 at 00:44 UTC |