in reply to Quicker way to do this IF statement 1-5

print "\$b has to be a number and is either 1, 2, 3, 4, or 5." if ($b +< 1 || $b > 5);
That is one method

Take a look at perlintro. It has good explenations of all the constructs