Missing comma after first argument to join or string function at ./joke.pl line 7, near "@_]"

Hmmm.... weird. Are you certain you copied it exactly? This is line 7:

for join$',@$die[        $%,$==>$|]}}map{[map{sub

There's no occurance of @_] there. There is one on line 6:

split//,pop@_]}@%=        map{my$die=$_;sub{print

I don't see anyplace there on line 6 where a comma is wanted, so maybe it really is talking about line 7, but on line 7 there most certainly is a comma after the first argument to join.

It has been reported to work on versions from 5.005 through 5.8.1, but it is possible that something changed from then to 5.8.3 that throws it off. If for example $' were handled differently, that could maybe break it. Or if the precedence tables changed -- but that seems unlikely; I don't thing the precedence tables are going to change much in Perl5, because that would break *lots* of existing code. (Perl6 is going to change them, but Perl6 is changing *lots* of stuff; Perl5 code will not be able to parse as Perl6 code and mean the same thing, generally, though Perl6 will be able to parse it as Perl5 code.)

I'm not sure what the newest Perl I have access to is, but I'm pretty sure it's not 5.8.3, so I'd have to do an upgrade. I can't justify that here; maybe at home later, time permitting -- but doublecheck also to make sure you have the code copied exactly.

;$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$;[-1]->();print

In reply to Re: How to run it? by jonadab
in thread Slashdot lamejoke generator by jonadab

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.