Is it helpful? No. Is it harmful? No, except that including that switch on a regex without variables might make me question the rest of your Perl understanding in a code review.
I'd say that it can be harmful. Given the dynamic nature of code, an /o on a RE could cause some hard-to-find bugs if the RE were modified to use a variable but the /o not removed. In fact, I'd advocate that /o on a RE without variables should illicit a warning when -w is in effect.
In reply to Re: •Re: RegEx re-compilation
by duff
in thread RegEx re-compilation
by habit_forming
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |