There is a Perl code line below where I get the message from perlcritic:
map { $total_ids += scalar @{$ids->{$_}} } @brands;
The message is:
"map" used in void context near 'map { $total_ids += scalar @{$ids->{$_}} } @brands;'
Can anyone help me to fix it?
mapreturns a list, which in void context is thrown away.As recommended by Perl::Critic::Policy::BuiltinFunctions::ProhibitVoidMap, turn your
mapinto aforeach