*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: sort | Section: 3p | Source: OpenBSD | File: sort.3p
sort(3p) Perl Programmers Reference Guide sort(3p) NAME sort - perl pragma to control sort() behaviour SYNOPSIS The sort pragma is now a no-op, and its use is discouraged. These three operations are valid, but have no effect: use sort 'stable'; # guarantee stability use sort 'defaults'; # revert to default behavior no sort 'stable'; # stability not important DESCRIPTION Historically the "sort" pragma you can control the behaviour of the builtin sort() function. Prior to v5.28.0 there were two other options: use sort '_mergesort'; use sort '_qsort'; # or '_quicksort' If you try and specify either of these in v5.28+ it will croak. The default sort has been stable since v5.8.0, and given this consistent behaviour for almost two decades, everyone has come to assume stability. Stability will remain the default - hence there is no need for a pragma for code to opt into stability "just in case" this changes - it won't. We do not foresee going back to offering multiple implementations of general purpose sorting - hence there is no future need to offer a pragma to choose between them. If you know that you care that much about performance of your sorting, and that for your use case and your data, it was worth investigating alternatives, possible to identify an alternative from our default that was better, and the cost of switching was worth it, then you know more than we do. Likely whatever choices we can give are not as good as implementing your own. (For example, a Radix sort can be faster than O(n log n), but can't be used for all keys and has larger overheads.) We are not averse to changing the sort algorithm, but we don't see the benefit in offering the choice of two general purpose implementations. CAVEATS The function sort::current() was provided to report the current state of the sort pragmata. This function was not exported, and there is no code to call it on CPAN. It is now deprecated, and will warn by default. As we no longer store any sort "state", it can no longer return the correct value, so it will always return the string "stable", as this is consistent with what we actually have implemented. perl v5.40.1 2023-02-15 sort(3p)

Navigation Options