sub validate_owner{ my ($str) = @_; print "Owner is $str in sub_validate_owner\n" if ($debug); # Remove leading and trailing whitespace. $str =~ s{\A \* | \s* \z}{}gxm; print "Owner is $str in sub_validate_owner\n" if ($debug); # if ($str =~ /nbk[A-z0-9]{4}/){ print "Error $str is not a valid job owner\n"; $error = 1; return 1; } if ($str =~ /nbd[A-z0-9]{4}/){ print "Error $str is not a valid job owner\n"; $error = 1; return 1; } if ($str =~ /root/){ print "Error $str is not a valid job owner\n"; $error = 1; return 1; }