in reply to Sorting, recursion, and tail-call optimizations

The sort docs aren't much help, but I suspect that when you give the sub name instead of a sub ref, the args aren't passed in @_. You could try adding
@_ ||= ($a,$b);

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Sorting, recursion, and tail-call optimizations
by Limbic~Region (Chancellor) on Jan 06, 2006 at 18:36 UTC
    Roy Johnson,
    The function isn't supposed to be called with any explicit args. That is the point of using the tail call optimization (re-using @_). I first auto-vivify the first element of @_ and then re-use it throughout. That part works great - it is the undefined $a and $b that baffles me. As does the mysterious *boom*.

    Cheers - L~R