Is it not rather that you can't easily tell from context whether foo is a hash or a hashref?
It's not paying attention to context. Last time I did that, I passed a reference to a named hash to a function, e.g., foo_function(\%hash), then in the function started using the argument as a hash instead of a hash reference, and inconsistently at that. And then going back to the calling function, and adding code that assumed the hash was a reference. TGFS (Thank Go(o?)d(ness)? for strict :)
| [reply] [d/l] |
I am religious about avoiding having a hash and a hashref in scope with the same name. That way lies insanity and (a couple of refactorings later) hard to track down bugs.
| [reply] |
Oh, I didn't actually have a hash and hashref in the same scope with the same name. Two functions, one with a hash, the other with a hashref, and me not paying attention to which was which. Nothing use strict couldn't find immediately.
| [reply] [d/l] |
Oh I can tell.
It is just that while coding, my fingers apparently can't (consistently at least).
This may have something to do with the fact that I use hashrefs a lot like I use hashes. Or the fact that I don't care because strict catches it so quickly, so I don't pay close enough attention to get it right. | [reply] |