Newsgroups: perl.perl6.internals
From: jcli...@mac.com (Jeff Clites)
Date: Tue, 6 Jan 2004 13:28:17 -0800
Local: Tues, Jan 6 2004 4:28 pm
Subject: Re: References to hash elements?
[ apologies for the duplicate email message from my last post--mail
client problems... ] On Jan 6, 2004, at 11:50 AM, Simon Cozens wrote: > Jeff Clites: But here what I'm copying is the _contents_ of the hash slot--so I'm >> $a = $hash{bar}; > Here you used the copy constructor before taking the reference. It copying a PerlString PMC, for instance. >> $b = \$hash{bar}; And here I'm not making a copy, but also the thing I'm taking a > Here you didn't make a copy before taking the reference. No copy, only reference to is not the same thing I copied above. Here, it's a reference to a hash slot. So maybe the way to think about it is: $a = $hash{bar}; $b = \$hash{bar}; So the first case involves copying a string, and the second involves JEff You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||