in reply to retain longest multi words units from hash
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
OK I see the problem, this is only partially solving your case:
use strict; use warnings; use Data::Dump qw/pp dd/; my %hash = ( 'rendition' => '3', 'automation' => '2', 'saturation' => '3', 'mass creation' => 2, 'automation technology' => 2, # why did you post broken code with a missing comma? 'automation technology process' => 3 ); delete @hash{ map { split / / } grep{/ /} keys %hash }; print pp \%hash;
{ "automation technology" => 2, "automation technology process" => 3, "mass creation" => 2, "rendition" => 3, "saturation" => 3, }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: retain longest multi words units from hash
by Corion (Patriarch) on Jul 28, 2018 at 11:41 UTC | |
by LanX (Saint) on Jul 28, 2018 at 11:48 UTC | |
|
Re^2: retain longest multi words units from hash
by LanX (Saint) on Jul 28, 2018 at 14:45 UTC | |
|
Re^2: retain longest multi words units from hash
by Anonymous Monk on Jul 28, 2018 at 12:02 UTC | |
by LanX (Saint) on Jul 28, 2018 at 12:25 UTC |