use FreezeThaw qw(freeze thaw); use Data::Dumper; $hashref = { a => {}, b => {} }; print Dumper($hashref); $copy = thaw freeze $hashref; print Dumper($copy);