Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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)) #

Reformatted per liz and davido ... thanks!

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

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


    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!


      "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?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2018-05-25 02:25 GMT
Find Nodes?
    Voting Booth?