#! /usr/bin/perl use strict; use warnings; use Storable qw( dclone ); my $hRef = { foo => { bar => 123, } }; my $copy = dclone( $hRef ); $hRef->{foo}->{bar} = 456; require Data::Dumper; print Data::Dumper->Dump( [ $hRef, $copy ], [ wq( *hRef *copy ], );