Is this what you are looking for ?
if ($target !~ /..../) {
print "Syntax Error: Target should be x or y or z\n";
pod2usage(-verbose => 1); # just the usage
exit;
}
Update
BTW, as I see you are a
perl@newbie are you using strict and warnings in your script? If not have a look at
Use strict warnings and diagnostics or die to see why it is a good idea.
Cheers,
R.
Pereant, qui ante nos nostra dixerunt!