It would be nice if there was a way to prevent the following typo-style errors for hashrefs, as 'strict' does for vars:
my $href = { key1 => 'foo' }; . . . if ( $href->{key_1} eq 'foo' ) { # celebrate wildly }
Of course, one could use 'defined' to tighten up the code. But it would be nice to stop hashrefs being accidentally abused somehow. As far as I know though, this is not really possible in a strict-like way, only on an ad-hoc basis. Any thoughts?
In reply to strict and hashrefs by danmcb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |