http://qs1969.pair.com?node_id=829360

andreas1234567 has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

I recently discovered i bug in my code. My intention was to create a hash reference with a key for each value of an array reference.

use strict; use warnings; use diagnostics; my $arr = [1,2,3]; my $hr = undef; map { $hr->{$_} } @{$arr};
The last line should have been written as
map { $hr->{$_} = 1 } @{$arr};
Could this bug have been picked up by some sibling of use warnings ?
--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]