my @list = qw/ 12 11 10 08 07 04 00 94 91 90 87 67 24 /; if (grep $a =~ /_($_)$/, @list){ say "matched" }