Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

$_="eval eval"; s/a/i/;

by o0lit3 (Friar)
on Aug 31, 2004 at 22:37 UTC ( #387348=obfuscated: print w/replies, xml ) Need Help??

The Reason

Several months ago, a co-worker asked me why someone would ever want to use multiple evals in a regular expression. At the time I had no good answer and even had difficulties producing a working example. Now (somewhat unfortunately), I can't seem to get those eee's out of my mind.

The Code
($_=join+qq e.e,map+ord,(join+qq ee,<DATA>)=~/[\d\.]/g) &&s e.+e(36).qq+.+.(95).qq+.+.(32)eeeeeeeeeeeeeeeeeeeee __DATA__ . .

The Challange:

The above script ends with 21 e's, several of which are meaningless. Can you determine how many e's can be eliminated without effecting the output?

An Unrelated Question

Unlike most of my other obfus, this script should run under both strict and -w. What is the general consensus regarding this rule? Is it considered bad etiquette if obfuscated code does not run under these options?

Replies are listed 'Best First'.
Re: $_="eval eval"; s/a/i/;
by jdalbec (Deacon) on Aug 31, 2004 at 23:53 UTC
    Highlight to read:
    8 e's are required, so 13 e's may be omitted. I notice that 8+13=21 are all Fibonacci numbers. Is that deliberate?
      ... Fibonacci numbers. Is that deliberate?

      Wow, very perceptive, jdalbec! The use of Fibonacci numbers is not coincidental; it's a sort of signature that I use in a lot of my obfuscated code. I meant for it to be a hidden element, but there you go finding it as the first replier!

      I (foolishy) started all this nonsense after posting my first obfuscation, Fibonacci, before becoming a member. The use of Fibonacci numbers in this particular obfuscation is (in all honesty) quite silly.

Re: $_="eval eval"; s/a/i/;
by grinder (Bishop) on Sep 01, 2004 at 07:33 UTC
    The above script ends with 21 e's, several of which are meaningless

    Well, BooK wrote 59 /e which, like the title suggests, ends with 59 e's, all of which are necessary! You'll have to try harder :o)

    should run under both strict and -w

    No, not bad etiquette at all. Just state the conditions beforehand.

    - another intruder with the mooring of the heat of the Perl

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2023-06-09 12:14 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (35 votes). Check out past polls.