in reply to How to duplicate objects?
Note that this does not clone any object referenced in the $original (those references will just get copied), so this does the minimal amount of work - while the Storable solution above copies everything it can find.my $copy = bless { %$original }, ref $original;
Quite often, what's actually needed is something in between these two extremes, which means you'll probably end up with the objects providing their own clone() and/or freeze() method(s).
|
|---|