Mayank Lahiri, a researcher at the University of Illinois at Chicago, has thrown down a golfing challenge for his 9-line program to send the FourSquare geolocation API randomly skewed arbitrary data.

I've already made him aware of my 5-line version which uses only the simplest of changes, and I am sure there is more to strip out of this. What would Perl Golf be without involving the Monks?

Unlike some golf challenges, this challenge includes any "standard" (which I take to mean "part of the core distribution as shipped") Perl modules. He's also concerned more with lines of code (let's assume logical lines of code and not just really long concatentations of different logical steps) than with character count, at least from his description. The full rules are included on the linked page. He promises to include any variations which use fewer lines and meet the specs he put forth on his journal. Code clarity is not one of his specs.

The original point of his journal entry is the insecurity through obscurity of the API in question. The golf challenge I think is just for a bit of fun. Once a program is under ten lines, I don't think it being any shorter is of much importance to prove his point. Still, as a chance to show off Perl's power and expressiveness, this is a golden opportunity. Bragging rights for the golfer with the smallest solution don't hurt, either.


In reply to Nine-line Perl example of gaming a geolocation service and an open invitation to golf it by mr_mischief

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!
  • 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.
  • 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, details, 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, summary, 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:
    & &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.