in reply to Moo different parameters for constructor
As others have suggested, BUILDARGS will do the job. Personally, I think you should consider:
1. my $date = MyDate->now; 2. my $date = MyDate->new(year => $y, month => $m, day => $d); 3. my $date = MyDate->parse("$y$m$d");
There's no reason to force them all to happen through the same constructor method. #1 and #3 would just be wrappers for #2.
|
|---|