#$perl -w use Data::Dumper ; use warnings ; use strict ; my %hash = ( "file" =>"log.txt" , size => "1000kb") ; $Data::Dumper::Deepcopy =1; my $send_string = Dumper \%hash; # Pretend that $send_string has been sent across the socket, then recvd. # Since $sendstring starts with $VAR1={...}, for "strict", we need # to pre-pend the "my", such that it reads "my $VAR1={...}" my $rcv_string = "my " . $send_string; my %hash_rehydrated = %{ +eval $rcv_string }; # Assuming trust here... print Dumper \%hash_rehydrated;