morgon has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
Sorry for being too lazy to read the documentation, I am sure I would find my answer here...
But I just spend 15 minutes (or more) on a bug where I wrote
where I should have writtenif($hash{key}) {
so my problem is the automatic stringification of hash-keys that prevents such a but to be discovered at compile-time.if($hash{$key}) {
Plenty of times this is exactly what I want, but sometimes (as here) it can conceal bugs - so is there a way to turn it off, so that accessing a hash-element via bareword would be a compiliation error?
I am sure there is...
Many thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: prevent stringification for hash-keys
by tobyink (Canon) on Feb 17, 2019 at 01:11 UTC | |
by 1nickt (Canon) on Feb 17, 2019 at 03:22 UTC | |
by soonix (Canon) on Feb 17, 2019 at 07:27 UTC | |
by 1nickt (Canon) on Feb 17, 2019 at 12:37 UTC | |
by soonix (Canon) on Feb 17, 2019 at 23:57 UTC | |
Re: prevent stringification for hash-keys
by 1nickt (Canon) on Feb 16, 2019 at 23:47 UTC | |
by morgon (Priest) on Feb 16, 2019 at 23:52 UTC |
Back to
Seekers of Perl Wisdom