The "e" being absent means "treat the replace expression as a double-quote string literal".
$x = '10+4';
print( "$x" ); # 10+4, not 14
The "e" being present means "treat the replace expression as a Perl expression".
The Perl expression $1 evaluates to the value of $1, which is the string 10+4.
$x = '10+4';
print( $x ); # 10+4, not 14
s/.../.../ee is an awful* way of saying s/.../eval .../e.
That means that not only is $1 treated as a Perl expression, so is the value returned by it.
$x = '10+4';
print( eval $x ); # 14
* — In my opinion, something as dangerous as eval EXPR shouldn't be hidden as an simple little "e".
Update: Added illustrative code.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.