Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: "ee" in Regular Expression: version issue?

by ikegami (Pope)
on Dec 04, 2012 at 11:38 UTC ( #1007072=note: print w/ replies, xml ) Need Help??


in reply to "ee" in Regular Expression: version issue?

$var =~ s/$lhs/$rhs/ee;
means
$var =~ s/$lhs/eval $rhs/e;
(Except that exceptions aren't caught.)

That means $rhs must contain valid Perl code, yet $1$2$3 is not valid Perl code. "$1$2$3" or $1.$2.$3 would be valid Perl code, so you want

$rhs = '"$1$2$3"';
or
$rhs = '$1.$2.$3';


Comment on Re: "ee" in Regular Expression: version issue?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007072]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-09-23 21:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (241 votes), past polls