I have a perl object (reference to array of references) like the below:
my $a = [ [$a, $ab, $c ], [$a, $b, $c] ] ;
and need to store it on the DB then retrieve it.
Could someone suggest a good mechanism to serialize even to compress it and then store it on the DB? Then deserialize it and use it in the code?
You may use any of the known serializers, e.g. JSON::XS or Storable.
Storableis better if you want to retrieve references as references, not as copies of values. Then save a serialized object in the field of any type (VARCHAR, BLOB, …) that satisfy storage requirements.Additionally, you can compress
$bytestream, for example, viaIO::Compress::Gzip