Actually, I'm a bit surprised that I do get the same warning with a slightly modified variant:
$ perl -Mstrict -Mwarnings -MData::Dumper -le 'my $hr; $hr->{stuff}{fo +o} for 1; print Dumper $hr' Useless use of hash element in void context at -e line 1. $VAR1 = { 'stuff' => {} };
As it autovivifies, it's not "useless", strictly speaking... Also, what about (intended) side effects with tied hashes?
In reply to Re^2: Possible useless use of map
by almut
in thread Possible useless use of map
by andreas1234567
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |