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

running B::Terse shows that the RHS is even precompiled and not evaluated at runtime:

lanx@lanx-1005HA:~$ perl -MO=Terse -e 's/(x)/$1.$1/re' LISTOP (0x8eb6668) leave [1] OP (0x8ec3040) enter COP (0x8eb6688) nextstate PMOP (0x8ebff20) subst LOGOP (0x8ebff00) substcont UNOP (0x8ebfbe8) null LISTOP (0x8ebfc38) scope OP (0x8ebeb28) null [181] BINOP (0x8ebfc18) concat [3] UNOP (0x8ebfd30) null [15] PADOP (0x8ebfe20) gvsv GV (0x8ef1c90) *1 UNOP (0x8ebfc98) null [15] PADOP (0x8ebfcb8) gvsv GV (0x8ef1c90) *1

That's why this rather ill construction works

lanx@lanx-1005HA:~$ perl -e 'sub bla { s/x/BEGIN{print "compiletime\n" +}/e }' compiletime

But still doesn't make the perldocs clearer...

Cheers Rolf

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