Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: data manipulation case insensitive match

by tangent (Vicar)
on Nov 16, 2019 at 16:41 UTC ( #11108793=note: print w/replies, xml ) Need Help??


in reply to data manipulation case insensitive match

Keeping your original code you could try this:
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;
Note: changed the way hash references are dereferenced to use the arrow operator.

Output:

$VAR1 = [ { 'targetL' => 'ahnenforschung', 'count' => 1, 'origin' => 'IB' }, { 'count' => 3, 'origin' => 'EU, IB', 'targetL' => 'akzent' } ];

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108793]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2022-01-24 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?