in reply to perldoc of s///ee wrong or just misleading?
Yes the wording is odd, but like a lot of perl docs, if you keep reading you will get all the details, like: A second e modifier will cause the replacement portion to be evaled before being run as a Perl expression.
I once wrote
One time I even tried to explain this way :)
my $string = 'string'; ## s/string/replacement/; $string->substitute( 'pattern', 'replacement' ); ## s/string/codehere/e; $string->substitute( 'pattern', sub { ... } ); ## s/string/codehere/ee; $string->substitute( 'pattern', sub { eval ... } ); ## s/string/codehere/eee; $string->substitute( 'pattern', sub { eval eval ... } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perldoc of s///ee wrong or just misleading? (read more)
by ikegami (Patriarch) on Dec 29, 2014 at 18:05 UTC |