my $regex = '\b(' + join('|', @nums) + ')\b';
Still the whole addition/concatenation problem.
Also, moving the capture into $regex doesn't address multiple captures per line. This may not even be a possibility in the OPer's application (nothing is ever said about this), but I like to defend against things like this.
Give a man a fish: <%-{-{-{-<
In reply to Re^4: Bolt on where a match is not found to a print script
by AnomalousMonk
in thread Bolt on where a match is not found to a print script
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |