For anyone looking at this and wondering whether to roll their own serialization, there might be some benefit gained by looking at this blog post that compares a list of several existing serializers and gives some advantages and disadvantages of each:
http://blogs.perl.org/users/steven_haryanto/2010/09/comparison-of-perl-serialization-modules.html
He mentions Data::Dumper, Storable, YAML::XS, Data::Dump, XML::Dumper, JSON::XS, JSYNC, and FreezeThaw. He concludes that there are features missing from all of them:
In conclusion, choice is good but I have not found my perfect general
serialization module yet. My two favorites are Storable and YAML::XS.
If JSYNC [was] faster and supported Regexp, or if YAML::XS or YAML::Syck
[could] output inline/compact YAML, that would be as near to perfect as I
would like it.
Also see the points people made in the comments. It's just good to get the perspective of people who've run into issues before, etc.
If you are rolling your own serialization, you might want to look at the pros and cons mentioned there (speed, ability to handle things like regular expressions and circular references, etc). This can possibly head off problems for you that you haven't realized you were likely to run into.
Also, when you are using Dumper for serialization, it's good to understand all the options Data::Dumper gives you for output.
Is it going into a database where, some time in the future, someone is going to want to do a SQL query with a LIKE pattern? If so, you'll be happy you used Sortkeys because then you can do LIKE '%akey=front%ckey=front_of_c%' and you only have one ordering to worry about instead of n factorial.
As an example, here's what a friend of mine uses for serialization with Dumper:
my $deflated = Data::Dumper->new([$data])->Purity(1)->Terse(1)->Deepcopy(1)->Sortkeys(1)->Indent(1)->Dump;
I would recommend reading the docs of Dumper so you can understand what modifications those options make.