On 11 August 2015 at 07:02, Marcos Barbeitos <msbarbei...@gmail.com> wrote: > Thanks for the tip, it works as expected, except when I pass the attribute > to the constructor. In that case, I get the original sequence, and not its > parsed version. > > I added a print statement to the 'around' modifier so that I could keep > track of how many times 'around' was called. > > I noticed that the modifier was called when you set the attribute and > everytime you fetch it, but not when it is passed to the constructor. As > Buddy noticed, maybe it really shouldn't be. > > No biggie, though, I found out that I may actually have to re-structure the > code and I'll probably have no need for the modifier after I do.
That's because the constructor doesn't set the attributes by passing them to $object->method($value), but instead does some magic in $object->meta-> ... What it seems like you really want is some sort of Type Coercion, so that when data of a given type is passed to the constructor, the type coercion unpacks it into a form suitable. -- Kent KENTNL - https://metacpan.org/author/KENTNL