Download the raw code.
The code is nicely laid out, has sensible variable names, and has some breathing-room here and there.
The variable names are short and gruffy, as is the custom in this type of algorithm.
Since this was the algorithm I had in mind, this was the algorithmic efficiency I had in mind.
Why settle for a measly
my $max_int = 2**31 - 1; (line 14) when we have
The vertical alignment on lines 24..26 is well taken, but could be even prettier with unspace.
Sub-in-a-sub (line 34). We like.
Lines 5 and 6 choose an
.end-based approach to indexing rather than a
*-based one. Not sure why, or if it helps understanding. Maybe the
.split( /\s+/ ) on line 47 could have been spelled