I want to check that a string matches multiple regex patterns. I came across a related question, which Brad Gilbert answered using the smartmatch operator:
my @matches = (
qr/.*\.so$/,
qr/.*_mdb\.v$/,
qr/.*daidir/,
qr/\.__solver_cache__/,
qr/csrc/,
qr/csrc\.vmc/,
qr/gensimv/,
);
if( $_ ~~ @matches ){
...
}
The if
statement is entered if any of the patterns match, but I want to check that all of the patterns match. How can I do this?