Jonathan Scott Duff skribis 2004-04-16 15:51 (-0500): > > To get an item out of a hash, you can write %varname{"key"}. > > You can also write %varname<<key>> if there aren't any spaces in > > the key. Finally, if the key doesn't have any characters in it > > except for letters, numbers and underscores, you can write > > %varname`key. > Except that you've put things in this explanation that shouldn't be > there IMHO. The %varname<<key>> is a special case, but not of "getting a > single item from a hash", rather it's a special case of a one element > list generated from << >> evaluating to the element. So, if you remove > that bit, it's the same as the two below just with different syntax.
I think %hash<<key key key>> is best explained as %hash{ << key key key >> } with implicit curlies, not as an alternative to curlies. This is where ` as a bareword-quoter would provide a somewhat consistent interface, as %hash`key would then just be %hash{`key}, but without the curlies. And :foo<<a>> and :foo`a would be :foo(<<a>>) and :foo(`a) without the parens. But I also like to think that // is m// with implicit m, instead of the other way around. Juerd