Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Looks like a great contender to replace the downtrodden TPJ. Anyone interested in the golf-master position detailed below?
Perl Golf

We have not figured out the rules, chosen the judges, or calculated what your chances of winning really are, but we do have the prizes Perl Mongers hats or tshirts along with a chance for fame and glory in the next issue of The Perl Review.

Solve the following problem with a ridiculously low number of keystrokes, uses Perl in some clever or devious way, or is otherwise interesting and send it to

    Convert a base 36 number, with the digits [0-9A-Z], to its base 10 representation
If you would like to be a judge, or the maintainer of this column, or have an interesting golf problem, let us know. We can send you a hat or a t-shirt too.
Update: To get it started, here is my first attempt.... 61 chars
#!/usr/bin/perl -wT use strict; my $base36 = shift; $base36 = 10 if !defined $base36; die "invalid input, only 0-9 and A-Z allowed\n" if $base36 !~ /^[0-9A-Z]+\z/; my $dec = base36($base36); print "$base36 => $dec\n"; sub base36 { # 1 2 3 4 5 6 #234567890123456789012345678901234567890123456789012345678901 $%+=$_*36**$?++for reverse map/\d/?$_:ord($_)-55,pop=~/./g;$% }


In reply to Fore!!! (was The Perl Review) by blakem
in thread The Perl Review by Kit

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, 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:
    & &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?

    What's my password?
    Create A New User
    [choroba]: :-D

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (8)
    As of 2018-05-28 11:03 GMT
    Find Nodes?
      Voting Booth?