in reply to Re^2: Strange hash array behavior
in thread Strange hash array behavior
Can you modify the code above to produce the result I am looking for...?You are making a shallow copy. You need a deep copy.
to:$r->{sizes} = $data2;
or$r->{sizes} = [ map { { %{$_} } } @{$data2} ];
oruse Clone qw( clone ); $r->{sizes} = clone($data2);
oruse Clone::PP qw( clone ); $r->{sizes} = clone($data2);
use Storable qw( dclone ); $r->{sizes} = dclone($data2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Strange hash array behavior
by Rodster001 (Pilgrim) on Jan 29, 2009 at 05:19 UTC | |
by ikegami (Patriarch) on Jan 29, 2009 at 15:26 UTC | |
by ig (Vicar) on Jan 29, 2009 at 05:53 UTC | |
by Rodster001 (Pilgrim) on Jan 29, 2009 at 06:14 UTC | |
by Util (Priest) on Jan 29, 2009 at 07:35 UTC | |
by Rodster001 (Pilgrim) on Jan 29, 2009 at 16:22 UTC | |
by Util (Priest) on Jan 29, 2009 at 06:27 UTC |