A simple way is to invert the logic: reject the string if there's anything found that doesn't match with what you like. So you invert your character class, and you negate your test.
if(/[^xyz]/) {
# It matches, though it shouldn't
print "No good.";
return 0;
} else {
print "Acceptable";
return 1;
}