in reply to Re^2: Function call in regex replacement string
in thread Function call in regex replacement string
However the following can work and at least gives a hint as to the evil lurking within:
Where the ee means you eval it, and then eval the result of that. Or in other words you execute whatever is in $replaceString as code. I would set that up more sanely as:for (@array) { s/$searchString/$replaceString/eeg; }
But then again I'm a sane sort of guy who doesn't want to worry about maintenance programmers on a vendetta.for (@array) { s/$searchString/$replace->()/eg; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Function call in regex replacement string
by PoorLuzer (Beadle) on Feb 25, 2009 at 09:27 UTC | |
by tilly (Archbishop) on Feb 26, 2009 at 01:23 UTC |