=~ m/^$path1|$path2|...etc/
I know LanX and kcott understand this, but here's a general side note. In a regex expression like the one quoted above, the ^ anchor is associated only with the first alternation, i.e., ^$path1. None of the other alternations are anchored.
The "precedence" of Perl ordered alternation is very low. This applies generally, so in
$str =~ m/ a b c | d | e | f g h /x;
the regex pattern "atoms" a b c comprise the first possible alternation, then d if the first alternation cannot match, then e, then the f g h sequence.
Use grouping, typically non-capturing, to disambiguate precedence. E.g., in
$str =~ m/ a b (?: c | d e | ... | etc) f g /x;
the sequence a b is required for a match, then the first of c or d e or ... or etc, then the required f g sequence.
Give a man a fish: <%-{-{-{-<