Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Magic q JAPH

by idsfa (Vicar)
on Sep 28, 2003 at 05:17 UTC ( #294715=obfuscated: print w/ replies, xml ) Need Help??

Fits in less than four full 80-char lines, so I'm calling it my first JAPH. Known good on debian unstable (perl 5.8.0) and stable (perl 5.6.1).

$_=q(vXvlrcYAGRKxl}mKnk|E[Nlf@beUE?~zOcOixyGxR~QHbFakKdCdNRNMvxdJudwan +juuU~FMLAalNl]xKrR{FKPCU}WynfhuNZmInLtCPEUp_pewMgf?fLJaKx?|kYiLhGs|SI +IYuadPj|c);y/?-~/@-\x7f/;sub _{map{$L++%2?"":$_}@_}sub L{join('',_(@_ +))}@_=unpack("B*",$_)=~/..(...)(...)/g;$Y=L(@_);$L++;$_=L(@_);s/(.{7} +)/0\1/g;eval pack("B*",$_);pnirt(q(JAPH)) #
Update:

Reformatted per liz and davido ... thanks!


Remember, when you stare long into the abyss, you could have been home eating ice cream.

Comment on Magic q JAPH
Download Code
Re: Magic q JAPH
by liz (Monsignor) on Sep 28, 2003 at 08:52 UTC
    Hmmm... I either get:
    Invalid range "@-" in transliteration operator
    or
    Undefined subroutine &main::pnirt called
    depending on the version of Perl I use.

    Liz

    Update:
    Indeed, as davido points out, it works if you put it all on one line. And I was thinking a JAPH should work just like that. Without "little assembly required"?

      I had to paste the individual lines all onto one line before I could get it to run. Once you've done that, you can run it through B::Deparse to get an idea of where it's safe to insert line breaks. Too bad the OP didn't break it at safe spots rather than stress out over trying to keep it to 40 columns.

      But then again, it can be confusing getting used to the text entry box at first. It wraps at 58 characters, making it tricky, especially for new monks, to know what to do about long lines.

      UPDATE: The original post has been fixed. Well done!

      Dave

      "If I had my life to do over again, I'd be a plumber." -- Albert Einstein

        No offense, but why are you cutting and pasting when they have that nice little link that says, "Download code"?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2014-12-18 12:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (51 votes), past polls