in reply to Deepcopy of complex structures.
How about Clone?
UPDATE: some codeuse strict; use warnings; use Clone qw(clone); use Data::Dumper; my $str; $str .= "{ $_ => " for 'a'..'z'; $str .= '}' x 26; my $orig = { nested_hash => eval $str, code_ref => sub { my $foo = 'bar'; sub{$foo} }, }; my $clone = clone($orig); print Dumper $clone->{nested_hash}; print $clone->{code_ref}->()->(), $/;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (jeffa) Re: Deepcopy of complex structures.
by BrowserUk (Patriarch) on Jan 21, 2003 at 02:11 UTC | |
by iguanodon (Priest) on Jan 21, 2003 at 03:29 UTC | |
by grantm (Parson) on Jan 21, 2003 at 03:42 UTC | |
by castaway (Parson) on Jan 21, 2003 at 08:24 UTC |