use feature qw( say ); my @pats = map qr/$_/, qw( a c ); for (qw( aaa bbb ccc ddd )) { say if $_ ~~ @pats; }