Mr.Vector!
Советую почитать раздел про регулярные выражения на PERL.
А вот и решение твоей задачки
Код:
$codeuser = '3132333435363738391925';
@A = ($codeuser =~ /(\w\w)/g);
#print " $_" for @A; # just for testing
#print "\n"; # just for testing
@B = grep(/19|25|2B/,@A);
if (@B) {
print "Error\nYou are using one or more of illegal symbols:";
print " $_" for @B;
print "\n";
}