Unless you're sure that the input file will only contain safe characters, you should call quotemeta on $_ inside the map.
Also, what's the benefit of chaining two map's like that, instead of combining them into one?
Edit: Oops, I only just now noticed that choroba already mentioned quotemeta in his answer. Sorry for the redundancy.
In reply to Re^2: Best approach to creating a regex from a filehandle
by smls
in thread Best approach to creating a regex from a filehandle
by fieroboom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |