Slash Boxes
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

use Perl Log In

Log In

[ Create a new account ]

david.romano (6556)

  (email not shown publicly)
AOL IM: imdavidromano (Add Buddy, Send Message)
+ -

  Comment: Re:Agreed (Score 1) on 2009.01.30 1:13

This same problem has bitten me about once every 2 months for the last two years (since switching to Java 1.5).

I remember this biting me a few years ago when I was doing text parsing and tagging, before Java 1.5. The project I was working on constantly reminded me of this difference from Perl because I actually had to translate the "prototype" code from C-styled Perl to Java for performance reasons (it was never benchmarked, actually). Sigh.

Read More 3 comments
Comments: 3
+ -

  Comment: Reduction operator (Score 1) on 2008.12.23 16:22

by david.romano on 2008.12.23 16:22 (#66597)
Attached to: My first experiment with Perl6
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' :-)
Read More 2 comments
Comments: 2