How can I store Perl Data Structures on the Hard Disk?
Sometimes we’d like to store arbitrary Perl 5 Data Structures on the hard disk for various reasons including persistence and communication. This is called serialisation (or serialization in American spelling), and can be performed in several ways. • Data-Dumper allows one to serialise arbitrary data structures into a human readable Perl code (which is also capable of evaluation). Note that performing string eval for arbitrary Perl code like that is not recommended for security reasons, so make sure you can trust that data. • Storable (another core module) serialises data structures to a binary format (make sure you use its portable format), and allows for serialising, deserialising, cloning a complex data structure, etc. This module is Perl 5-specific, though. • JSON is short for “JavaScript Object Notation” and can be used to serialise data structures using JS notation. The JSON-XS CPAN module is recommended for that. Note that JavaScript does not support several Perl 5-specific featu