pc2 has asked for the wisdom of the Perl Monks concerning the following question:
but this /$var/ technique doesn't work. is there some other technique? salutations,$var = "([f][o][o]|[b][a][r])"; @ret = grep(/$var/, @foo);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: set value of a variable to a regexp
by moritz (Cardinal) on Aug 19, 2007 at 09:58 UTC | |
|
Re: set value of a variable to a regexp
by FunkyMonk (Bishop) on Aug 19, 2007 at 10:01 UTC | |
|
Re: set value of a variable to a regexp
by codeacrobat (Chaplain) on Aug 19, 2007 at 11:51 UTC |