in reply to Perl Golf-- testing array intersection

Not only does it return an incorrect result, it contains a gratuitous space. Prepending "scalar " to the code fixes the result and with the extra space removed gives a 34 stroke solution. There is a 29 stroke solution that gives the correct result.


DWIM is Perl's answer to Gödel
  • Comment on Re: Perl Golf-- testing array intersection

Replies are listed 'Best First'.
Re^2: Perl Golf-- testing array intersection
by Aristotle (Chancellor) on Jan 30, 2006 at 21:36 UTC

    Prepending 0+ also fixes the context issue but is 4 characters shorter than “scalar”.

    Makeshifts last the longest.

      Spoiler :) Actually 5 strokes shorter because scalar requires a space after it before the grep.


      DWIM is Perl's answer to Gödel