What is the best module or approach to serialize data into a database?
Currently I am looking into Storable functions freeze
and thaw
, example:
use Storable qw(freeze thaw);
use strict;
my %array_test = ('Year Average' => 0.1, 'Color Average' => 0.8, 'Humans' => 0, 'Units' => 1);
my $serialized_data = freeze(\%array_test);
my %deserialized_data = %{ thaw($serialized_data) };
What I would like to know:
- Are there any native command in Perl to serialize and deserialize data?
- Is Storable a good approach to serialize and deserialize into a database or is there better approch / modules around?
- Should I do anything else with the serialization before storing it, like encoding it?