If $pattern won't be changing over the lifetime of the script, we can add the //o modifier, which directs Perl to only perform variable substitutions once
It wouldn't make sense to use this optimization in the context you've shown - even if it were embedded in a loop, there is no variable being interpolated.
A point on formatting posts - please do not use <pre> tags. Rather, write normal text, separate paragraphs with <p> tags and wrap your code in <code> tags. See How do I post a question effectively?.
In reply to Re: A regular expression (or regex)
by kennethk
in thread A regular expression (or regex)
by anakin30
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |