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, }