I think I should highlight what I think is a Perl bug that affects
golf games.

You can find all 12-letter words with no repeating character with:

perl -anF// -e'my%F;@F{@F}=F;169-@F*keys%F||print' /usr/dict/words

(That solution would definitely not win a fwp golf game :)

You may be surprised to learn, however, that this fails:

fred.pl:
#!/usr/bin/perl -anF//
my%F;@F{@F}=F;169-@F*keys%F||print

perl fred.pl /usr/dict/words          (oops, syntax error)

Interestingly, you can make fred.pl work by manually
null-terminating the first line. For example:

adjust.pl:
#!/usr/bin/perl -lp
$.==1 and $_.="\0"

perl adjust.pl fred.pl >fred2.pl
perl fred2.pl /usr/dict/words         (this works!)

I am mentioning this because it may affect the scoring rule
if a golf solution uses the -F option. I suggest you allow
the null-terminate hack and subtract one from the golf score
(because you do not require the terminating null when you run
directly from the command line via -e).

Thankfully, this did not affect Santa's game because -F was
quite useless there.

There are some other options that work directly from the command
line but do not work via shebang. However, -F is the only one
that I can think of that is vital to golfers.

Andrew.

Reply via email to