kiat has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

Greetings :)

Suppose you want to accept a scalar value containing only numbers from 1-5, how do you do that? Other numbers such as '0' and '6' and other non-numeric characters should not be accepted (so, $scalar1 = '1334' is accepted, $scalar2 = '1340' is out and so is $scalar3 = '155q')