Syntactic Confectionery Delight | |
PerlMonks |
Re: Any module for saving data as perl data?by Discipulus (Canon) |
on Apr 29, 2016 at 07:27 UTC ( [id://1161854]=note: print w/replies, xml ) | Need Help?? |
Storable is a core module since ever. It does exactly what you ask for. See it's synopsis for examples. Data::Dumper is another core module that can store Perl's data to disk. In addition many other modules can store Perl datastructures into a file and retrieve them later: for example YAML Every module has some limitation or feature: read a this thread where afoken describes Data::Dumper JSON Storable YAML differences and others point to other possibilies to accomplish with your task. update: In the above thread i point to Sereal-Comparison-Graphs which can be intersting too, being Sereal a worth to try module. I used to convert a a datastructure (an array) from Storable to YAML and viceversa with two simple oneliners:
L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|