| Substitution | Expression evaluated for each match | If the operator was implemented as a function |
|---|---|---|
| s/pat/repl/ | qq/repl/ | subst($_, qr/pat/, sub { qq/repl/ }) |
| s/pat/repl/e | repl | subst($_, qr/pat/, sub { repl }) |
| s/pat/repl/ee | eval(repl) | subst($_, qr/pat/, sub { eval(repl) }) |
In both of the last two cases, repl is evaluated as a scalar expression and its result is expected to be a string.
The docs are incorrect or confusing.
In reply to Re: perldoc of s///ee wrong or just misleading?
by ikegami
in thread perldoc of s///ee wrong or just misleading?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |