=pod Idea is to match the nick name with the correct first name and return the correct name which matches with the user entered nick name. =cut sub matchNickname { my $nickTemp; foreach my $key(keys %nicknames) { my $value = $nicknames{$key}; if(lc $name eq lc $key){ print "user typed ".$name." Match the key ".$key." and value is $value\n\n"; $nickTemp = $value; @nickArray = split '\W+', $nickTemp; foreach $nickTemp(@nickArray) { if($DEBUG){print "The name $name could be <$nickTemp> or ";} } } #print "$key ==> $value\n"; #print "$nickTemp\n"; } #print "Value of nickTemp is $nickTemp\n"; }