On Fri, Sep 25, 2009 at 12:38 PM, John P. Linderman <jpl@research.att.com> wrote: > perldoc -f sort > > is pretty clear about wanting integer returns... > > If SUBNAME is specified, it gives the name of a subroutine > that returns an integer less than, equal to, or greater > than 0, depending on how the elements of the list are to be > ordered. (The "<=>" and "cmp" operators are extremely > useful in such routines.) > > (note *integer*, not "a string that looks like an integer") > and the error message, but this is Perl! Programmers are supposed to be allowed to be careless about switching between numbers and strings. How much of "darkpan" is affected by this stricture? If Zefram were to deliver a patch to, for instance, `perform a "looks-like-a-number" check and if so, try again` in the spot where the exception in question is raised, would that patch have a chance of achieving application? Ideally, the "side effect numerification" would occur on the constant string "1" in a COW manner, even though the value has changed hands a couple of times, so that little smidge of CPU would only get used once per constant instead of every time, or the numerification could be made persistent by adding the :lvalue attribute to the comparison routine.