in reply to Re: Re: Little things ;)
in thread Little things ;)

Update: hmm... on further reading, I think the original point was that you don't need the scalar instead of the notion that adding parens would clarify what keys was doing.... so, nevermind.


Why would the parens make it any clearer? I think you might be misunderstanding whats happening here. From keys:

In a scalar context [keys], returns the number of keys [in the hash]
Comparing this to length (since it behaves in a similiar way) which of these is clearer:
$x = length $y; $x = (length $y);

It looks like you think (keys %y) behaves like @{[keys %y]}... i.e. return the list of keys, package them up into an array, then return the member count of the array.

-Blake