in reply to How to determine a variable value is a number

In a regex, \d stands for a digit, so if you use
if ($item =~ /^\d+$/) { # do something }
It will do something for every item that contains only digits. The ^ marks the start and $ marks the end of the string, telling the regex that you want it to match only if every character can be matched. Hope this helps.

elusion : http://matt.diephouse.com