in reply to check if a number is in a list
if (grep $_ == $x, @array) { print "Found $x in the array!\n"; } [download]
if (grep /^$x$/, @array){ ... } [download]