Your code doesn't even compile ($contents is undeclared).
And what's the purpose of the first loop in the notify
sub? It overwrites the variable in each iteration, but
you aren't doing anything with the variable in the loop
If your problem lies in how to serialize a hash, I suggest
using YAML. This produces compact, human readable code,
unlike the at this site popular Data::Dumper.
Abigail
Comment on Re: Iterating Through a Hash and Emailing the Result