in reply to Creating a Moose object at run-time

You can do complicated things with Moose::Meta::Attribute and Moose::Meta::Class (and the other Moose::Meta modules). I haven't delved deep into the Moose::Meta stuff, so I can't be more helpful. But from what I can tell, there's usually a simpler way, like what jeffa has suggested.

  • Comment on Re: Creating a Moose object at run-time

Replies are listed 'Best First'.
Re^2: Creating a Moose object at run-time
by gnosti (Chaplain) on Oct 23, 2015 at 00:01 UTC
    there's usually a simpler way, like what jeffa has suggested.

    How about not using Moose at all? That seems the simplest.

    Edit: I realize this sounds kind of snarky, but if you need ad-hoc behavior, Moose may not be the best fit.

        I realize this sounds kind of snarky ..

      Nope, that's fine -- I knew that the question I was asking was pretty open-ended. For now, I using just a hashref, and it's working just fine. My little script is processing over 12,000 records in just over two seconds, so I'm happy with the performance.

      Alex / talexb / Toronto

      Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.