Use /o when
- writing for a perl 5.005 and less.
- You are nano-optimizing to avoid the null operation of a pp_regcomp given a qr// object
Use qr// when
- writing for a perl 5.6 and greater.
- You want the syntax affordance of being able to say qr/\s/ rather than "\\s" (assuming your interpolating into some larger expression)
Rely on /$regex/ implementation details when
- you've bothered to read the source and know exactly what it's doing
Do not use /o when
- writing for humans to read (because almost no one understands what /o does)
- on perls 5.6 and greater
- ever. It's just bad style now.
Do not use qr// when
- on perl 5.005 and lower
- you're writing a sub expression that's going to be interpolated elsewhere and you care that the regexp compiler takes longer to compile strings like '(?-xism:...)' slower than '...'.
Do not rely on /$regex/ implementation details when
- you haven't read the source to pp_regcomp.