I have an array containing some PCRE matching patterns (like "prefix_.*") and I'm comparing a string with all the patterns of the array. Currently, I'm working with this code:
foreach (@matchingPatterns) {
if ("$string" =~ "$_") {
[do something]
}
}
This code is working well but I'm sure that there is a prettier way to do that in Perl (without any loop?).
Am I wrong? ;)