Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Tuesday December 16, 2003
04:49 PM

Nice Billboard

[ #16373 ]
You can figure it out yourself. :)
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • perl -e 'print chr while($_=shift);' 78 111 119 32 72 105 114 105 110 103

    A modest 73 for starters

    • perl -e 'print chr for(qw(78 111 119 32 72 105 114 105 110 103))'
      • Less one stroke ...

        perl -e 'print chr for qw(78 111 119 32 72 105 114 105 110 103)'

        • How unsurprising that we all came up with the same solution:
          perl -e'print chr for qw( 78 111 119 32 72 105 114 105 110 103 );
          was what I did before I even saw the replies.

          Hooray for laziness.

          --

          --
          xoa

          • Here's some packing:
            perl -e'print pack"C*",78,111,119,32,72,105,114,105,110,103'
            and if we can require the user to hit Return + Ctrl-D:
            perl -pe'$_=pack"C*",78,111,119,32,72,105,114,105,110,103'
            --

            --
            xoa

    • A different approach ...

      perl -e 'print chr for @ARGV' 78 111 119 32 72 105 114 105 110 103

    • perl -e 'print 78.111.119.32.72.105.114.105.110.103' 52 characters
      • What's sad is that I don't even understand why that works. Nice job, though. :)
        • From 'man perldata':

          A literal of the form "v1.20.300.4000" is parsed as a string composed
          of characters with the specified ordinals.  This form, known as
          v-strings, provides an alternative, more readable way to construct
          strings, rather than use the somewhat less readable interpolation form
          "\x{1}\x{14}\x{12c}\x{fa0}".  This is useful for representing Unicode
          strings, and for comparing version "numbers" using the string compari-
          son operators, "cmp", "gt", "lt" etc.  If there are two or more dot

  • If someone on one of my teams were to write code like that, they'd get a serious talking to.
  • Why write code? I just read it, that was faster than typing a program and the data.