Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: data manipulation case insensitive match

by tangent (Parson)
on Nov 16, 2019 at 16:41 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-25 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found