http://qs1969.pair.com?node_id=585310

When writing Perl code, it's always fun to use some of the undocumented operators.

The good ol' +- operator always comes in handy.  My personal favorite is the ever-reliable '= operator.  And what obfuscation would be complete without a terminal /+ operator?

Can you find any other undocumented operators below?

@ == "GqwpWrlplbnTbnpDwghav"=~ /.../g; @ +- map { +map++ $_,@ =} +$ = ... 3**7; @ '= split /(?=[A-Q])/, join $* ,@ =; die + qq + @'$ /+

The inspiration for the technique used came indirectly from this node by blazar.

Update:  Fixed wording, as pointed out by jdporter.


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re: Undocumented Operator Japh
by chargrill (Parson) on Nov 21, 2006 at 22:52 UTC

    Clever! liverpole++

    Here's a crack at deobfuscating it:

    Update: Cleared up the "obfuscated deobfuscation" as noted by ysth, though the original test was written to most closely resemble (from at least my point of view) the original obfuscated code. Apologies for any confusion. Also added a little extra explanation (with reference to associated documentation).



    --chargrill
    s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)
Re: Undocumented Operator Japh
by wulvrine (Friar) on Nov 21, 2006 at 18:24 UTC
    Stop breaking deparse! You are making my head hurt! <secret ++>
    My eyes are spinning from working this one out, even with help!
    Heck of a pickup on an obscure ahem feature :) GREAT JOB!

    s&&VALKYRIE &&& print $_^q|!4 =+;' *|
Re: Undocumented Operator Japh
by diotalevi (Canon) on Nov 22, 2006 at 00:29 UTC

    I dub this, "most readable JAPH evar!" It's pretty though. I like it.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊