What's the difference between using the Clone module and simply assigning
$ref1 = $ref2?
Thanks.
Teddy
- Original Message -
From: zentara [EMAIL PROTECTED]
To: beginners@perl.org
Sent: Thursday, December 30, 2004 3:45 PM
Subject: Re: Copying a hash-of-hashes
On Wed, 29 Dec 2004 22:58
-Message d'origine-
De : Peter Rabbitson [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 30 décembre 2004 04:58
À : beginners@perl.org
Objet : Copying a hash-of-hashes
Hello List,
To explain the problem I am having, I wrote a simple snipet that
doesn't
do
anything meaningful other
The question is whether there is an elegant way to produce a complete copy
of a hash-of-hashes-of-hashes-...-of-hashes for internal subroutine purposes
and make sure that all references will be translated properly as well,
leaving the subroutine no ability to modify the main hash.
You might
Hello List,
To explain the problem I am having, I wrote a simple snipet
that doesn't do
anything meaningful other than illustrating the behaviour I
want to avoid:
my %hoh = (
1 = {
a = 5, b = 5
},
2 = 5
);
Hi,
The three CPAN modules suitable for copying data structures are:
Storable, Data::Dumper and FreezeThaw. Of these, Storable offers the
dclone method which addresses the
problem on hand.
use Storable qw(dclone);
$ref2 = dclone ($ref1);
The method works on references to scalars, arrays and
Hello List,
To explain the problem I am having, I wrote a simple snipet that doesn't do
anything meaningful other than illustrating the behaviour I want to avoid:
my %hoh = (
1 = {
a = 5, b = 5
},
2 = 5
);
my @res =