>>>>> "MGS" == Michael G Schwern <[EMAIL PROTECTED]> writes:
MGS> On Sun, Jan 28, 2001 at 04:28:08PM +0100, [EMAIL PROTECTED] wrote:
>> Aliasing again. They keys are copies, the values aliases.
MGS> How bizarre? Why does it work that way?
well, my take is that it works for the same reason that values now
(5.6+) returns aliases to the actual values of a hash. people wanted
access the the actual values of a hash when doing
foreach ( values %hash )
so they can mung them. so just using %hash and getting a list of
key/value pairs would behave the same but obviously the keys have to be
copies or you would have to rehash if you modified them. the values are
aliased the same way as if you used values.
so
chop %hash ;
and
chop values %hash ;
do the exact same results with different levels of efficiency and golf
scores. typical of abigail to notice that. :)
uri
--
Uri Guttman --------- [EMAIL PROTECTED] ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com