Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: deep copy of hash of hash

by cmic (Acolyte)
on May 27, 2019 at 09:25 UTC ( [id://11100566]=note: print w/replies, xml ) Need Help??


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 (Bishop) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11100566]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-25 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found