if (rindex($number, $last_digit) == length($number) - 1) { print "Matches!\n" }