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 ☆☆☆☆ :)


In reply to Re^2: perldoc of s///ee wrong or just misleading? by LanX
in thread perldoc of s///ee wrong or just misleading? by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.