Create the new object y by cloning the all the contents of x, recursively.
classes
var x,y: TPersistent; ... y.assign(x); ...
let y = structuredClone(x);
use v5.7.3; use Storable qw(dclone);
my $x = [ 1, 2, [ 'a' ], { x => [3,4] } ]; my $y = dclone $x;
import copy
y = copy.deepcopy(x)
y = Marshal.load(Marshal.dump(x))
No security, no password. Other people might choose the same nickname.