Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Parts of this post are quotes from Welcome to The Perl Golf Page and are not intended to take credit from the author of said page.)

I would like to propose a new section for PerlMonks.org - Perl Golf. Perl Golf is a competition to find the shortest (fewest keystrokes) Perl code to solve a given problem. This is different from obfuscated perl where you are trying to come up with code that is difficult to understand. Perl Golf is more the demonstration of Laziness. At times, Laziness has been explained as doing more with less. A variation of that is doing the same with less. Perl Golf is the embodyment of this version of Laziness

As an example, a co-worker has this code on his whiteboard:

$x = length +(sort map 1x y===c, keys %h)[-1];

He put this up as a challenge for us to figure out what it did. But he got this from a Perl Golf entry that he had seen. I found it interesting because it reminded me of an alternate syntax for the map statement that I rarely use. There are also a few other techniques that are educational in this little snippet of code.

I think a format similar to that used in the Snippets Section would be good. You enter a title and description of the problem, and a code entry for people to beat. People would reply with hopefully shorter entries. See the links below for more info on how Perl Golf has developed over time.


In reply to Perl Golf - A proposal for a new section of PerlMonks.org by johannz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
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!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (8)
    As of 2014-07-29 11:15 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (215 votes), past polls