in reply to Re^3: hex code passed from command line is interpreted literally in substitution
in thread hex code passed from command line is interpreted literally in substitution
The /e option on your s/// makes no difference there for two reasons.
First, you aren't testing what was asked about. $rep = "\x30"; is identical to $rep = "0";. "0" evaluates to "0" so /e makes no difference.
Second, s/.../$rep/ (no /e) does string interpolation on the $rep part which results in the value from $rep being used. s/.../$rep/e (with /e) interpolates $rep as Perl code and the value of eval '$rep' is also just the value stored in $rep.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: hex code passed from command line is interpreted literally in substitution (strike 3)
by BrowserUk (Patriarch) on Mar 10, 2011 at 17:51 UTC |