in reply to Weird syntax. What does this goto statement do?

> there are some lines in this code which look totally Chinese to me

Given this script was originally written by Ton Hospel (thospel on Perl Monks), it would be more accurate to change Chinese to Alien. :) This was such a common problem in the early Perl golf days (when Ton's solutions were unfathomable by ordinary mortals) that it was felt that Ton must be an alien!

More examples of Ton's alien golfing exploits can be found by searching for Hospel in:

BTW, is there any reason to embed the whole script in your post rather than pointing to where you got it from (e.g. on CPAN).

👁️🍾👍🦟
  • Comment on Re: Weird syntax. What does this goto statement do?

Replies are listed 'Best First'.
Re^2: Weird syntax. What does this goto statement do?
by Bod (Parson) on Jan 01, 2024 at 23:18 UTC

    There seems to be a common theme of golf from eyepopslikeamosquito

    How about some scores...

    use List::Util qw(shuffle); @n=qw(Andrew Bob Charlie David);sub h{my$n=pop;$n=~s/([aeiou])/lc$1/eg +;$n}print"$_\t"for shuffle map{h($_)}@n;print"\n",map{$_."\t".int(ran +d(10)+70)."\t".int(rand(10)+70)."\t".int(rand(10)+70)."\t".int(rand(1 +0)+70)."\n"}@n;

Re^2: Weird syntax. What does this goto statement do?
by harangzsolt33 (Deacon) on Dec 30, 2023 at 16:03 UTC
    Wow, interesting!

    No, the only reason I included the entire block of code is because originally, it was longer and it did not run at first (on TinyPerl 5.8), so I made some changes to it, and now it works on TinyPerl 5.8. I tried to cut it down to minimum size, so only the inflater is included, nothing extra. In addition, I inserted a block of sample compressed code so it runs. I wanted to make sure I include something that runs without errors, not just a line of code without any context. Btw I tried to use the readmore tag, and it doesn't seem to work. I don't know why.

      The readme tag works when the node is embedded in another node (e.g. in the Monastery Gates or as a reply to another node). When viewing the node itself, the tag is always expanded. I configured a different CSS style for it so I can detect it even when expanded.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]