keys(%S) =@C _fields; identical to keys(%S) = scalar @C_fields;
and perldoc -f keys
Used as an lvalue, keys allow you to increase the number of hash codes allocated for a given hash . This can increase efficiency if you know that the hash will become big. (This is similar to pre-expanding the array by assigning a larger number to the $ # array.) If you say
keys %hash = 200;
then% hash will have at least 200 buckets allocated - in fact 256 of them, since it is rounded to the next capacity of two.
So, hash %S will get the number of buckets whose size is not less than @C_fields .
Dry27 source share