The classic tab-delimited file is usually my typical choice for the intermediate format, but reading and writing (although simple) these gets repetitive and more complicated for more complex data structures. I finally looked into alternatives (something I clearly should have done awhile ago) and came across Storable.
Basically, it allows you to save/open any perl data structure to/from a file.
It is very easy to use:
use Storable;Check it out if you have never used it before.
#Reference to any data structure
$data_ref;
store($data_ref, 'my_storage_file');
#later in same or different script
$new_data_ref = retrieve('my_storage_file');
3 comments:
But remember to be careful with versions of Storable, the byte order changes between some versions.
We had that problem a year ago when you asked me to install it.
Yup, I think that scared me away from it for awhile. I also noticed that they have a machine independent format for use on networks/clusters called using nstore.
I have this issue and need an alternative. Storable might be the right solution. Thanks for the resource.
Post a Comment