in reply to Any module for saving data as perl data?

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:

# WARNING windows quotes # storable to yaml perl -MYAML -MStorable -e "print Dump @{retrieve ($ARGV[0])};" # yaml to storable perl -e "use YAML (LoadFile); use Storable qw(nstore); @ar = LoadFile( +$ARGV[0]); nstore(\@ar, $ARGV[1])"

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.