Don't Panic.

I thought this was fitting with the Hitchhikers Guide to The Galaxy out in theaters now.  Windows variant available under read more.

#!/usr/bin/perl -w use strict; srand(42); map { my $l = $_; my ($n, $r) = (0, int(rand(128))); print map { chr($r) if($l == ($n += $_)) } qw(100 43 6 159 12 4 28 96 15 72 2 72 158 338 275 34 60 155 327 38 153 18 119 271 212 57); } (1 .. 28 +25);

This code is not so much a pure obfu as it is a demonstration of why it is a Really Bad Idea to call srand with a known number (but you should have known that already).

Ok, here it is, the update you've all been waiting for:  the version of this code that works under Windows!  In completing this project I learned a very truth { view: change; !important } [1]:  while the interface to rand is standardized across OS boundaries, the output for a given seed to srand is not.  IMHO, output from rand for a given seed should be standardized in Perl 6.  Well, without further ado, here is the code:

#!/usr/bin/perl -w use strict; srand(42); map { my $l = $_; my ($n, $r) = (0, int(rand(128))); print map { chr($r) if($l == ($n += $_)) } qw(253 170 79 20 166 414 240 374 123 32 149 95 56 64 128 185 7 72 316 323 40 67 216 8 17 19); } (1 .. +3635);



[1] Yes, I have way too much CSS running through my head... translating to english results in the phrase "view changing important truth".


In reply to Why 42 is the answer to the ultimate question. by northwind

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.