Looking over my cow-orker's shoulder today, and criticising (those who can't do, teach!) I was pointing out to him that:
{
local $" = '|';
$good = $file =~ /^(@patterns)$/;
}
is around thirty times faster than
for my $pattern (@patterns) {
$good = 1, last if $file =~ /^$pattern$/
}
But he did have something curious in there, and (now to my point) I learned that
(?i:foo) does a case-insensitive non-remembering pattern match. I can't imagine if I'll ever use it, but I thought it was cute.
Has anyone else learned anything interesting today?
Jasper