in reply to Re^2: How best to replicate/copy a hash of hashes
in thread How best to replicate/copy a hash of hashes
I found that it put a '\n' between the key and data in the cloned hash
That can only be an artifact of the way you are inspecting the cloned hash, because Clone::clone() adds nothing:
use Clone qw[ clone ];; my $n = 0; my %hash = map{ $_, ++$n} 'a' .. 'e';; pp \%hash;; { a => 1, b => 2, c => 3, d => 4, e => 5 } my $copy = clone \%hash;; pp $copy;; { a => 1, b => 2, c => 3, d => 4, e => 5 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How best to replicate/copy a hash of hashes
by flexvault (Monsignor) on Oct 04, 2010 at 19:24 UTC |