in reply to data manipulation case insensitive match
Keeping your original code you could try this:
Note: changed the way hash references are dereferenced to use the arrow operator.for my $h (@suggestionsTemp) { my $targetL = lc $h->{targetL}; push @suggestionsUnsorted, ($targets{$targetL}={targetL=>$targetL} +) unless $targets{$targetL}; $targets{$targetL}{origin}{$h->{origin}}++; $targets{$targetL}{count}++; } $_->{origin} = join ', ', sort keys %{$_->{origin}} for values %target +s;
Output:
$VAR1 = [ { 'targetL' => 'ahnenforschung', 'count' => 1, 'origin' => 'IB' }, { 'count' => 3, 'origin' => 'EU, IB', 'targetL' => 'akzent' } ];
|
---|
In Section
Seekers of Perl Wisdom