in reply to Re: Check exist of anonymous subroutine before calling it within regexp substitute?
in thread Check exist of anonymous subroutine before calling it within regexp substitute?
s/(\w+)(?(?{ !$d{$1} })(?!))/$d{$1}->($1)/ge;
Your solution fails if the non-existant word is followed by a one ("1"). For example, try input "baz1".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Check exist of anonymous subroutine before calling it within regexp substitute?
by oha (Friar) on Oct 30, 2009 at 08:57 UTC | |
by ikegami (Patriarch) on Oct 30, 2009 at 14:53 UTC |