Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I am using YAML::XS to load yaml generated in Java. Is there a way to keep YAML::XS from blessing objects? If not, I wanted to overload stringification for java.util.UUID objects but perl won't let me declare the package.
Suggestions on how to get YAML::XS to not bless my refs, how to declare a package with name 'java.util.UUID', or other suggestions on fixing stringification are appreciated.use YAML::XS; my $ref = YAML::XS::Load(join('',<DATA>)); print "$ref->{fooUuid}\n"; print ref $ref->{fooUuid}, "\n"; 1; __DATA__ --- fooUuid: !java.util.UUID 39809f4e-93b9-11e1-89b4-db41381ff4b7
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Dealing with blessed scalars when using YAML::XS::Load
by Khen1950fx (Canon) on May 02, 2012 at 05:28 UTC | |
Re: Dealing with blessed scalars when using YAML::XS::Load
by tye (Sage) on May 01, 2012 at 23:10 UTC | |
by Anonymous Monk on May 02, 2012 at 14:59 UTC | |
by tye (Sage) on May 02, 2012 at 16:07 UTC | |
by Anonymous Monk on Nov 07, 2012 at 02:07 UTC |
Back to
Seekers of Perl Wisdom