in reply to Internally compressing Perl data
I think Inline::Struct will do what you want.
After Compline,Zaxo