Recursively copy perl datatypes