in reply to Need to match number other than 1

how about:
if ($str =~ /^(?!1$)\d+$/) { do_stuff($str); }
Regards,
Xicheng