in reply to Re: perldoc of s///ee wrong or just misleading?
in thread perldoc of s///ee wrong or just misleading?

I know what you mean and I agree about what is happening, but the perldoc is wrong!

it should say

ee Execute right side as code then eval the resulting string.

NOT

ee Evaluate the right side as a string then eval the result.

see:

lanx@lanx-1005HA:~$ perl -MO=Terse -e ' s/(x)/$1.$1/ree ' LISTOP (0x9f99668) leave [1] OP (0x9fa6040) enter COP (0x9f99688) nextstate PMOP (0x9fa2f20) subst LOGOP (0x9fa2e20) substcont UNOP (0x9fa2f00) entereval [256] # --- string eval of resu +lt UNOP (0x9fa2c58) null LISTOP (0x9fa2be8) scope # --- precompiled $1.$ +1 OP (0x9fa1b28) null [181] BINOP (0x9fa2c38) concat [3] UNOP (0x9fa2cb8) null [15] PADOP (0x9fa2d30) gvsv GV (0x9fd4c90) + *1 UNOP (0x9fa2c18) null [15] PADOP (0x9fa2c98) gvsv GV (0x9fd4c90) + *1 -e syntax OK

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)