if ($zahl1 =~ tr/0-9//c or $zahl2 =~ tr/0-9//c) { die "Ungültige Zahlen" } print eval "$zahl1 $function[$f] $zahl2";