James Edward Gray II <[EMAIL PROTECTED]> wrote:

>I believe you just want:
>
>$new = $orig;
>
>You're trying to copy the reference and = generally means copy.
>
>>     print "orig:$orig, new:$new\n";


True, but ... (1) the requirement for a deep copy is that you can modify anything in 
the original data structure and not have the change reflected in the copy, which means 
that (2) any references in the copy have to refer to something other than what was 
refered to in the original while (3) preserving any literal values at the leaf nodes 
of the entire data structure, which I take to mean that (4) when duplicating refs to 
scalars, I have to create another copy of the literal value and then create a ref to 
that new copy (which is what I was trying but failing to do in my code).  Right?

I'll admit I'm not real clear on what I need to be doing, especially since I'm not at 
all clear about Perl internal data structures and how Perl represents literal values 
and whether you can actually have two separate copies of the same literal value or not 
... oy vey.

I'll check out storable, thx for the redirection.

__________________________________________________________________
New! Unlimited Access from the Netscape Internet Service.
Beta test the new Netscape Internet Service for only $1.00 per month until 3/1/04.
Sign up today at http://isp.netscape.com/register
Act now to get a personalized email address!

Netscape. Just the Net You Need.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to