in reply to Regular expressions and Arrays

The usual approach is to use grep e.g
do_something(@compare) if grep { $test =~ $_ } @compare;
However the first function from List::Util is better suited for this situation e.g
use List::Util 'first'; do_something(@compare) if first { $test =~ $_ } @compare;
HTH

_________
broquaint