in reply to Re: Sorting, recursion, and tail-call optimizations
in thread Sorting, recursion, and tail-call optimizations

kwaping,
I doubt it. The barewords error only comes into play when you put a block around my_sort without the parens. It becomes ambigous to parser and the parens are needed to tell it that it is a function call. This doesn't explain (to me at least) why
@data = map { join '/', @$_ } sort { my_sort() } @data; # works @data = map { join '/', @$_ } sort my_sort @data; # breaks

Cheers - L~R

Replies are listed 'Best First'.
Re^3: Sorting, recursion, and tail-call optimizations
by kwaping (Priest) on Jan 06, 2006 at 17:06 UTC
    Well, this is purely speculation, but I was just thinking that maybe there was an error generated that was somehow internal to the sort function and wasn't elegantly passed along to $!. For what it's worth, the error received on OSX was "Bus error".

      "Bus error" is likely to translate to "Invalid access": using a bad pointer.


      DWIM is Perl's answer to Gödel