Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I went off of your examples and fiddled around a bit more with a reduction operator, and came up with this:

    say (([+] @x XeqX @x) - @x.elems)/2;

    It appears to work, and doesn't require the diagonal cross operator. The diagonal cross operator does seem like it would be a nice tool to have, tho' :-)
    • Having thought it through, my "diagonal cross" should almost certainly be prefix, not infix -- I can't think what a diagonal cross with a different array would mean. So:

      say [+] %eq% @x

      if I can figure out how to implement it!