You can use any of the famous serializers, for example. JSON :: XS or Storable .
Storableit's better if you want to get links as links, and not as copies of values. Then save the serialized object in a field of any type (VARCHAR, BLOB, ...) that satisfy the storage requirements.
use Storable qw(nfreeze thaw);
use DBI;
my $data = [ [$a, $b, $c ], [ $a, $b, $c ] ];
my $bytestream = nfreeze $data;
$dbh->do('insert into table (field) values(?)', undef, $bytestream);
$bytestream = $dbh->selectrow_array('select field from table where ...');
$data = thaw $bytestream;
, $bytestream, , IO::Compress::Gzip
my $bytestream = gzip nfreeze $data;