use constant TITLES => { 'Dr.' => 1, 'Prof.' => 1, 'Mrs.' => 1, 'Ms.' => 1, 'Miss' => 1, 'Mr.' => 1 }; my ($title) = $D_title =~ /^(.*)$/g if exists TITLES()->{$D_title};