Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Dynamically create objects from YAML

by stvn (Monsignor)
on Oct 18, 2010 at 19:35 UTC ( #866034=note: print w/ replies, xml ) Need Help??


in reply to Dynamically create objects from YAML

You actually have a couple of choices for YAML and Moose.

First is MooseX::Storage, which is a full fledged serialization framework which no only supports YAML, but also JSON and Storable and will handle both serializing to text or to a file.

If that is more then you really are looking for, then you might want to take a look at MooseX::YAML which works best with YAML::XS and will reconstruct your Moose object in the correct way using MooseX::Blessed::Reconstruct to do all the dirty work.

The major difference between these two modules being that MooseX::Storage handles reading and writing, while MooseX::YAML is really mostly just concerned with reading since you would basically just use plain old YAML to do the writing for you.

-stvn


Comment on Re: Dynamically create objects from YAML

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://866034]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (14)
As of 2015-07-06 16:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (77 votes), past polls