An4ximandre has asked for the wisdom of the Perl Monks concerning the following question:
Dear venerable Monks, I am seeking wisdom about Moose Object attribute. Well I would like to know if there exists a way to define an attribute that refers to an Object, in particular an XML::Simple object. I did something like that :
has 'xml' =>(is=>rw, isa=>'XML::Simple').And then I set the xml attribute as this
sub set_xml{ (my $self, my $xml)=@_; $self->xml($xml); }
But each time I call this method I obtain the following error : Attribute (xml) does not pass the type constraint because: Validation failed for 'XML::Simple' with value HASH(0x3775688). I can't get rid of this error . Thanks In advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Object as Moose Object attribute
by Your Mother (Archbishop) on Nov 02, 2015 at 20:08 UTC | |
by An4ximandre (Novice) on Nov 02, 2015 at 20:14 UTC | |
by Your Mother (Archbishop) on Nov 02, 2015 at 20:21 UTC | |
by An4ximandre (Novice) on Nov 02, 2015 at 20:26 UTC | |
by Your Mother (Archbishop) on Nov 02, 2015 at 20:46 UTC | |
| |
by Anonymous Monk on Nov 02, 2015 at 20:49 UTC | |
| |
|
Re: Object as Moose Object attribute
by Anonymous Monk on Nov 02, 2015 at 20:00 UTC | |
by An4ximandre (Novice) on Nov 02, 2015 at 20:09 UTC |