in reply to Re: Subroutines within if statements
in thread Subroutines within if statements

Nowadays you can use

use 5.010; if ("$answer" ~~ [ 'add', 'a' ]) { ... }
I explicitly stringify $answer because if $answer happens to be something else (like an object) the ~~ operator will act differently and I don't want that. On the contrary, I want to allow objects that may stringify to "add" or "a".

lodin