I was playing around with this golf in #perl irc channel the other day and I was wondering if anyoen had any brilliant ideas to better my current solution. The goal is simple, write a sub that finds the number of elements of @y that match elements in @x. Repeated elements in either can be ignored, that is, if @y has "A", "A", and @x has "A", you only need to report one match. @x and @y may be globals so initialization won't count for your strokes, same with the sub boilerplate.
My best is 28 strokes, can you do better?
In reply to Perl Golf-- testing array intersection by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |