Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: hex code passed from command line is interpreted literally in substitution (strike 3)

by tye (Sage)
on Mar 10, 2011 at 17:31 UTC ( [id://892460]=note: print w/replies, xml ) Need Help??


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        

  • Comment on Re^4: hex code passed from command line is interpreted literally in substitution (strike 3)
  • Select or Download Code

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

    Indeed. I completely missed the significance of the problem.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-23 21:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found