http://qs1969.pair.com?node_id=620473


in reply to grep with multiple choice

grep { /^Julia_Roberts/ } @arr
should be enough. There's nothing particularly different with this "grep with multiple choice". The only thing it seems you are missing is that the grep block can match different values provided you code a suitable matching sub, like I did with a regex. If your problem is really to find out the array elements starting with $s, this will work:
grep { /^\Q$s\E/ } @arr; # regex with quoted interpolation # or grep { index $_, $s == 0 } @arr; # more efficient