if (scalar (grep {/$i/} @lst)) { ...}