recursively copy Perl datatypes