in reply to Problem Defining AoA from Named AoA
What you want to investigate is what they call a deep copy or deep cloning. I recall merlyn wrote a magazine article or two about them. See UR col 30.
Also check out Storable, a standard module that includes a function for deep copying: dclone.
p.s. The difference between variables containing the same reference, and aliases, is just this: only a direct full assignment to one of the variables, will break the interconnection. Let me give an example:
$x = { a => 1 }; # a reference $y = $x; # a copy of a reference points to the same thing $y->{a}++; # increments $x->{a} $y->{b} = 3; # adds a hash item $x->{b} $y = { c => 0 }; # breaks the connection between $x and $y $y->{c}++; # no effect on $x
|
|---|