in reply to Re^2: my 'if' condition doesn't work, why?
in thread my 'if' condition doesn't work, why?

"shame that it's not standard Perl but instead requires an extra module"

Well, there does exist something similar in core Perl since 5.10: the smart match operator! Example:

if ($n ~~ [40, 47, 76]) { ...; }

However, smart match acts pretty weird in some cases (not the above case), so it is not usually a great idea to use it.