if ($temp2 =~ m/^([a-zA-Z]+)$/) { $naam = $1; } else { die "Wrong input"; }