I'm very new to golf and don't know the ground rules and was amazed by hans_moleman's solution and simply blown away by japhy's evolution, but.... (/me hear's the groans)...trying japhy's final answer on my win32 (that has -w permenantly enabled) system I got:

C:\test>185653 185653.pl 16Use of uninitialized value in print at C:\test\185653.pl line 1. C:\test>

Ignoring the warning which I could turn off, I noticed that it reports its own length (under win32 etc. etc) as 16!

So, I played and came up with this, which (on my Wi...) does a little better and (visually at least :) complies with the 'rules'

(I see a newline after the number :),

and beats japhy's by 3!...and runs with -w and no errors!

C:\test>185649 185649.pl 13 C:\test>

And the code

C:\test>type 185649.pl print-s pop C:\test>

As an aside, in a unicode world, maybe the requirements should have been "number of bytes"?


In reply to Re: Re: Golfing on a quiet Friday afternoon... by BrowserUk
in thread Golfing on a quiet Friday afternoon... by hans_moleman

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.