in reply to perl 5.8.8 equivalent of ?|

In this particular case, you could probably do something like this (as the non-matching captures aren't defined):

#!/usr/bin/perl -l for (qw(OTHFIL.FOO BARFIL)) { my ($foo) = grep defined($_), /OTHFIL\.([A-Z]{3})|([A-Z]{3})FIL/; print $foo; } __END__ FOO BAR