in reply to Re: Creating regex from arrays
in thread Creating regex from arrays
map {s#|#\\|#s; $_} @results
I hope you don't have any other uses for @results as you've modified it in-place.
Perl doesn't have a great idiom for this. This type of mistake and several others are so common that I really think Perl should have a 'filter' keyword.
And thanks(++) for bringing up the important point about escaping regular expression metacharacters and prompting diotalevi's reply (which is what I'd use).
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^2: Creating regex from arrays (oops)
by liz (Monsignor) on Jul 29, 2003 at 18:13 UTC | |
by tye (Sage) on Jul 29, 2003 at 23:19 UTC | |
by liz (Monsignor) on Jul 30, 2003 at 07:22 UTC |