P is for Practical PerlMonks

### Obfuscated code

 Need Help??

Got some code which would take a Perl grand master to understand without running it? Post it in this section so we can stare at it in awe.

Word of warning, though: Don't be too cocky with your post — almost inevitably someone will post a reply that does the exact same thing in even fewer characters!

 Predecrement a constant? 1 direct reply — Read more / Contribute by monsoon on Feb 28, 2017 at 02:14 Not much obfuscation really. The idea was to try and see if it was possible with some unusual code to predecrement a constant or at least to pretend to do so. *0=sub: lvalue {my$l}, print --0 ->(!0) [download] Dungeons and Dragons die roller (Golf) 4 direct replies — Read more / Contribute by zsl on Sep 30, 2016 at 16:18 60 byte solution, not counting hashbang, to take strings that look like '2d4' or '2d4+10' and give you the result: -n ($d,$s,$=)=split/d|\+/;$=+=1+rand$s for 1..$d;print$=,$/ [download] Anyone wants to try and beat my record?$thanks++ Another japh No replies — Read more | Post response by Mandrake on Aug 03, 2016 at 21:43 Had a bit of spare time today !  {sub OrO{OrOOr (eval(chr(@_[0])))}}push @Or,++$_ for(0..(++$_*++$_)*++$_);{sub OrOOr{print@_[0]}} OrO(Or(Or0()+1+Or0(),Or0()+1))&&OrO(Or(Or0()+Or0(), Or0()+Or0()/(Or0()-2)))&&OrO(Or(0,(Or0()*(Or0()-1) -1)))&&OrO(Or(Or0()*2+1,(Or0()*2+1)/(Or0()-1)));sub Or{$Or[@_[0]].$Or[@_[1]]}sub Or0{$_= "\[\[\[\[";$_=((split//));} [download] Self-constructing Japh 1 direct reply — Read more / Contribute by golux on Jul 30, 2016 at 17:37 It's been a while. Here's an obfuscated script written over 4 years ago that finally got finished up. Though it technically works in Windows with "perl -MWin32::Console::ANSI

 Set the new obfuscation standard Title: code@?#!: Use:

text here (a paragraph)

and:  code here to format your post; it's "PerlMonks-approved HTML":

• Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
• Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
• Read Where should I post X? if you're not absolutely sure you're posting in the right place.
• Posts may use any of the Perl Monks Approved HTML tags:
a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
• You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
 For: Use: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?

Create A New User
Chatterbox?
 [thezip]: So I have a script that generates a log file. After script completion, I want tohave VIM open this logfile. [thezip]: i don't get the command line "back" until I close VIM. No what I want to happen... [thezip]: I currently don't have access to CYGWIN, else I'd just do a tail -f on the logfile. [Corion]: thezip: If you want to open vim and can live with opening a second console window, use start "The results" vim.exe c:\path\to\logfile .log [thezip]: Ooops... I lied. I guess Cygwin is back. I'll just do a tail -f instead. Better. Sorry for the noise.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2017-03-27 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should Pluto Get Its Planethood Back?

Results (321 votes). Check out past polls.