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:17 -0500, [EMAIL PROTECTED] (Peter Rabbitson)
wrote:

>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.

#!/usr/bin/perl
use Clone qw(clone);
my $newhash = clone($hashref);


see "perldoc Clone"




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to