in reply to Re: Re: Re: Reducing Perl OO boilerplate
in thread Reducing Perl OO boilerplate
With a package..use Foo; sub new(*) { die "wuh?"; } $x = new Foo();
new2 works, new breaks. THAT is my point. Why would anyone do this, I don't know. But people have pointed out that ->new is the better convention.package Foo; sub new { return bless { a => 1 }, shift; } sub new2 { return bless { a => 1 }, shift; } 1;
So before you berate me more on what a constructor is, i suggest you reread my posts. Thank you.
|
---|