http://www.perlmonks.org?node_id=89375


in reply to Recursive copier

You could get the effect of a deep copy by serializing and deserializing a data structure, using some method of serialization. Eg. Data::Dumper or Storable.

Or you could also investigate the Clone module, which I've not seen before but which is on CPAN. It looks like it should do what you want:

use Clone qw(clone); my $b = clone($a);