Re: Copying a hash-of-hashes
From: Zentara (zentara_at_highstream.net)
Date: 12/30/04
- Next message: Jonathan Paton: "Re: IO::Socket::UNIX questions"
- Previous message: Randy W. Sims: "Re: Patches"
- In reply to: Peter Rabbitson: "Copying a hash-of-hashes"
- Next in thread: Octavian Rasnita: "Re: Copying a hash-of-hashes"
- Reply:(deleted message) Octavian Rasnita: "Re: Copying a hash-of-hashes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: beginners@perl.org Date: Thu, 30 Dec 2004 08:45:45 -0500
On Wed, 29 Dec 2004 22:58:17 -0500, rabbit@rabbit.us (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"
-- I'm not really a human, but I play one on earth. http://zentara.net/japh.html
- Next message: Jonathan Paton: "Re: IO::Socket::UNIX questions"
- Previous message: Randy W. Sims: "Re: Patches"
- In reply to: Peter Rabbitson: "Copying a hash-of-hashes"
- Next in thread: Octavian Rasnita: "Re: Copying a hash-of-hashes"
- Reply:(deleted message) Octavian Rasnita: "Re: Copying a hash-of-hashes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|