in reply to Re: deep copy of hash of hash
in thread deep copy of hash of hash

I get it. However, I loaded CPAN Clone module, but as I
use Clone 'Clone'; #or even: use Clone::More qw( clone );
Perl -c answers: "Clone" is not exported by the Clone module What should I do? (sorry to be a bit noob there...) TYA
-- cmic. Life helps. Perl Too.

Replies are listed 'Best First'.
Re^3: deep copy of hash of hash
by hippo (Archbishop) on May 27, 2019 at 10:07 UTC

    Perl is case sensitive. Here is an SSCCE:

    use strict; use warnings; use Test::More tests => 2; use Clone 'clone'; my %x = ( miller => {lastname => 'michael', tel => '222'}, duran => {lastname => 'peggy', tel => '333'}, ); my %y = %{clone (\%x)}; is_deeply (\%x, \%y); $x{duran}{tel} = '444'; isnt ($x{duran}{tel}, $y{duran}{tel});
Re^3: deep copy of hash of hash
by johngg (Canon) on May 27, 2019 at 09:34 UTC

    The documentation says Use Clone 'clone'; (note the lower case) but you have asked to import Clone with an initial upper case letter. I can't test as I don't have that module but perhaps that is your problem.

    Cheers,

    JohnGG