I'm looking for a solution for using complex keys (arbitrary references) as hash keys, except that they perform deep comparison on the keys as opposed to reference comparison.
I am looking for a function preferably in a core module that serializes arbitrary references (possibly excluding subroutine and typeglob references) to strings in such a way that they can be reconstituted later.
my @complex_key = qw[key1 key2];
my %hash;
$hash{serialize([@complex_key])} = 'value';
deserialize((keys %hash)[0]);
# should deeply equal [@complex_key]