in reply to Re: Is setting attributes with BUILD in Moose a bad idea?
in thread Is setting attributes with BUILD in Moose a bad idea?

Yeah, after posting this question, I boned up on Moose construction. One important thing I learned is that Moose will just throw out arguments to the object that aren't used; I had always assumed that would throw an error. So what I ended up doing is using a combination of BUILDARGS and BUILD to process the arguments passed to the constructor before setting the attribs attribute and was able to just get rid of the attrIbs attribute. I think it has made my code a little less inscrutable.

Thanks for your input.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re^3: Is setting attributes with BUILD in Moose a bad idea?
by choroba (Cardinal) on Dec 01, 2017 at 10:06 UTC
    > Moose will just throw out arguments to the object that aren't used

    Raison d'être of MooseX::StrictConstructor.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
Re^3: Is setting attributes with BUILD in Moose a bad idea?
by Anonymous Monk on Dec 01, 2017 at 07:41 UTC

    Yeah, after posting this question, I boned up on Moose construction. One important thing I learned is that Moose will just throw out arguments to the object that aren't used; I had always assumed that would throw an error. So what I ended up doing is using a combination of BUILDARGS and BUILD to process the arguments passed to the constructor before setting the attribs attribute and was able to just get rid of the attrIbs attribute. I think it has made my code a little less inscrutable.

    That sounds so bizzare when you say it out loud, is Moose really that impenetrable?