use Data::Dumper; use Storable qw(nfreeze thaw); my $request = { TYPE => 'UPLOAD', DATA => { file1 => 'content1', file2 => 'content2' } }; my $serialized = nfreeze $request; # send this binary string my $deserialized = thaw $serialized; # round trip! print Dumper $deserialized;