my @name_parts = split /(\W)/, $name; my $clantag = exists $clanhash{$nameparts[0]} ? $nameparts[0] . $nameparts[1] : $nameparts[1] . $nameparts[2];