This "issue" is not something to take into account. $var and $sock allow for the proposed functionality, and both may also contain wildcards in the actual name. People who choose to include wildcards in their name shouldn't be surprised that when trying to iterate through a collection based on a wildcard, it may cause unrequired effects. That's their design choice, and their problem.

It wouldn't form any sort of problem, since some new syntax should be used so that it is clear you are trying to use a wildcarded string, not an actual name. A .col property for example. This way, only when .col is used, is the htb name seen as a wildcard, whereas in all its normal uses it remains as it is, being the name is treated as plaintext, even if it contains wildcards. That means, those who don't use wildcards in their hash table name, will be able to use it just fine, and those who do put wildcards in their hash table name shouldn't complain, as they didn't think things through.