athanasia has asked for the wisdom of the Perl Monks concerning the following question:
So far, so good. What if I want to replace each item with a string that is the concatenation of the result of function1, of the character "/" and the result of another function, function2. Then using this code:@newlist = grep (s/(\d+-PVC_\d+)/ &function1($1)/e, @oldlist);
(of course) gives me the result of a division :-) How can I use s// with /e but in a way that evaluates, then quotes, then evaluates again?@newlist = grep (s/(\d+-PVC_\d+)/ &function1($1) \/ &function2($1)/e, +@oldlist);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: s// with e option : evaluate, quote, evaluate
by Fletch (Bishop) on Mar 31, 2009 at 13:49 UTC | |
|
Re: s// with e option : evaluate, quote, evaluate
by Limbic~Region (Chancellor) on Mar 31, 2009 at 13:53 UTC | |
|
Re: s// with e option : evaluate, quote, evaluate
by ikegami (Patriarch) on Mar 31, 2009 at 14:00 UTC |