in reply to Object as Moose Object attribute

Can you show some short example code that reproduces the issue? If I had to guess, I'd say you're trying to store the result of a call to XMLin, which does not return an object of type XML::Simple, but returns a pure Perl data structure, so you'll probably have to set your Moose type constraint accordingly.

Replies are listed 'Best First'.
Re^2: Object as Moose Object attribute
by An4ximandre (Novice) on Nov 02, 2015 at 20:09 UTC

    Hi, thanks for the answer, Yes I am calling set_xml with an XMLin result as follows:

    my $parser = new XML::Simple; $o->set_xml($parser->XMLin($data));

    As you guess, I am far to be a perl expert, What do you mean saying 'Set your Moose type constraint accordingly ' ? Is it possible to return a pure XML::Simple object, or this means nothing in perl ? Thanks !