Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

New Obfuscation Trick!

by japhy (Canon)
on Nov 26, 2002 at 16:35 UTC ( #215863=obfuscated: print w/replies, xml ) Need Help??

As discovered by Nicholas Clark:
$J=q$JAPH$;print"${"; J}s rule

Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: New Obfuscation Trick!
by Felonious (Chaplain) on Nov 27, 2002 at 04:59 UTC
    ++japhy:) Interesting how code can be mixed in with it as well...

    sub a_naked { print 'Just another' } print qq|${ print "I gotta be...\n";| a_naked} Perl hacker

    The early worm gets the bird.
Re: New Obfuscation Trick!
by dingus (Friar) on Nov 26, 2002 at 17:28 UTC
    Doesn't work for me as is. Are you sure you don't mean
    $J=q$JAPH$;print"${J}s rule";


    Enter any 47-digit prime number to continue.
      It does work for me, in both forms:
      perl -le ' J}s rule' JAPHs rule perl -le ' $J=q$JAPH$;print"${J}s rule"; ' JAPHs rule
      But I don't understand the first version. Why does it work? perl 5.8.0 on linux, btw.

      -- Dan

        Something to do with the lexer I believe, or so I've read.


      Ok I see why I thought it didn't work. I habitually test fragments like this in an eval statement because I have my own home rolled "Interpreted Perl Console"©. In the interpreted console it fails. If I make a trivial perl script it works.

      Can anyone explain why it doesn't work in an eval and does work as a program?

      #!perl #this script doesn't work my $t = <<'EOT' ; $J=q$JAPH$;print"${"; J}s rule EOT print "$t\nResult:\n"; eval $t; ------------------------------ #!perl #this script works $J=q$JAPH$;print"${"; J}s rule


      Enter any 47-digit prime number to continue.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://215863]
Approved by TStanley
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2017-03-30 18:46 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (362 votes). Check out past polls.