![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re^3: Sorting result of function callby jbert (Priest) |
on Dec 20, 2006 at 10:18 UTC ( #590876=note: print w/replies, xml ) | Need Help?? |
Yes, I'd expect "sort subname" to mean "sort the empty list with the comparison func subname" - because "sort bareword LIST" means sort the (possibly empty) list with bareword as a comparison func.
And I'd expect "sort subname()" to mean "invoke subname to get a list, to sort with the default comparator" - because I interpret "subname()" to always mean "invoke subname". So I'd expect your first two examples to have different behaviour (but not the behaviour we get). But I'm not sure my expectations are in line with "documented reality", so I'm loath to say there definitely is a bug. I'm hoping to learn something in this thread :-)
In Section
Seekers of Perl Wisdom
|
|