my %input = ( "NaMe" => "Fred", "iD" => "123", "PET" => "Cat", "spoon" => "garbage", ); my %caseCorrection = ( "name" => "Name", "id" => "ID", "pet" => "pet", ); my %output; %output = map { $caseCorrection{lc $_} => $input{$_} } grep { exists $caseCorrection{lc $_} } keys %input; my $getString = join ";", map { "$_=$output{$_}" } keys %output;