But that reminds me of another possible optimization: if @tag doesn't contain regexes but only constant substrings, index might speed up things.
So instead of if ($_ =~ m/$something/){ ... }, you can write if (0 <= index $_, $something).
In reply to Re^2: Better solution to the code
by moritz
in thread Better solution to the code
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |