That's not true. m/.../ only recompiles if the contents of any interpolated variable has changed. Demo:
use re 'debug'; foreach (qw( abc abc def )) { print("==============================\n"); print("$_\n"); print("\n"); /$_/; }
Update: Oops, I didn't notice you reversed the loops in addition to moving the regexp.
In reply to Re^2: Slow Regex - How to Optimize
by ikegami
in thread Slow Regex - How to Optimize
by noslenj123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |