Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

oh for y///e

by bhildred (Novice)
on Dec 10, 2013 at 20:54 UTC ( #1066506=obfuscated: print w/replies, xml ) Need Help??

too bad this doesn't work.

while(<DATA>){y/a-zA-Z/b-zaZA-Y/e}

Replies are listed 'Best First'.
Re: oh for y///e
by kcott (Bishop) on Dec 11, 2013 at 14:39 UTC

    G'day bhildred,

    "too bad this doesn't work.
    while(<DATA>){y/a-zA-Z/b-zaZA-Y/e}"

    'e' is not a valid option for y/// — see perlop: Quote-Like Operators.

    "this doesn't work" is a useless error report. What were you expecting it to do?

    -- Ken

Re: oh for y///e
by Eily (Monsignor) on Dec 11, 2013 at 14:27 UTC

    What are you trying to do with the /e switch? eval 'b-zaZA-Y'? I don't see the point. And if you want to eval the result, just do eval y/a-zA-Z/b-zaZA-Y/r while <DATA>;

    And if you just put the /e by mistake, just take it away and your code will work just fine.

      What are you trying to do with the /e switch? eval 'b-zaZA-Y'? I don't see the point.
      Maybe something like:
      $cryped = substitution_cypher(); $text =~ y/a-z/$crypted/e;
      instead of
      eval "\$text =~ y/a-z/$crypted/";
        It would be cool when writing Obfuscated Code to eval the results of a transform without using eval to make it obvious what you are doing.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2021-12-01 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?