| 1 | package Sort::Key; | ||||||||||
| 2 | |||||||||||
| 3 | 5 | our $VERSION = '1.33'; | |||||||||
| 4 | |||||||||||
| 5 | 5 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 5 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 5 | ▶ | use Sort::Key::Types; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 5 | require Exporter; | |||||||||
| 14 | |||||||||||
| 15 | 5 | our @ISA = qw(Exporter); | |||||||||
| 16 | 5 | our @EXPORT_OK = qw( nsort nsort_inplace | |||||||||
| 17 | isort isort_inplace | ||||||||||
| 18 | usort usort_inplace | ||||||||||
| 19 | rsort rsort_inplace | ||||||||||
| 20 | rnsort rnsort_inplace | ||||||||||
| 21 | risort risort_inplace | ||||||||||
| 22 | rusort rusort_inplace | ||||||||||
| 23 | |||||||||||
| 24 | keysort keysort_inplace | ||||||||||
| 25 | rkeysort rkeysort_inplace | ||||||||||
| 26 | nkeysort nkeysort_inplace | ||||||||||
| 27 | rnkeysort rnkeysort_inplace | ||||||||||
| 28 | ikeysort ikeysort_inplace | ||||||||||
| 29 | rikeysort rikeysort_inplace | ||||||||||
| 30 | ukeysort ukeysort_inplace | ||||||||||
| 31 | rukeysort rukeysort_inplace | ||||||||||
| 32 | |||||||||||
| 33 | multikeysorter multikeysorter_inplace); | ||||||||||
| 34 | |||||||||||
| 35 | 5 | require XSLoader; | |||||||||
| 36 | 5 | XSLoader::load('Sort::Key', $VERSION); | |||||||||
| 37 | |||||||||||
| 38 | 13 | ▶ | sub multikeysorter { | ||||||||
|
Subroutine
multikeysorter: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||
| 39 | 13 | ▶ | if (ref $_[0] eq 'CODE') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 6 | my $keygen = shift; | |||||||||
| 41 | 6 | ▶ | @_ or croak "too few keys"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | 6 | my $ptypes = Sort::Key::Types::combine_types(@_); | |||||||||
| 43 | 6 | my $sub = Sort::Key::Types::combine_sub($keygen, undef, @_); | |||||||||
| 44 | 6 | return _multikeysorter($ptypes, $sub, undef); | |||||||||
| 45 | } | ||||||||||
| 46 | else { | ||||||||||
| 47 | 7 | ▶ | @_ or croak "too few keys"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 7 | my $ptypes = Sort::Key::Types::combine_types(@_); | |||||||||
| 49 | 7 | my $sub = Sort::Key::Types::combine_sub('@_', undef, @_); | |||||||||
| 50 | 7 | return _multikeysorter($ptypes, undef, $sub) | |||||||||
| 51 | } | ||||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 11 | ▶ | sub multikeysorter_inplace { | ||||||||
|
Subroutine
multikeysorter_inplace: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||
| 55 | 11 | ▶ | if (ref $_[0] eq 'CODE') { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 56 | 6 | my $keygen = shift; | |||||||||
| 57 | 6 | ▶ | @_ or croak "too few keys"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | 6 | my $ptypes = Sort::Key::Types::combine_types(@_); | |||||||||
| 59 | 6 | my $sub = Sort::Key::Types::combine_sub($keygen, undef, @_); | |||||||||
| 60 | 6 | return _multikeysorter_inplace($ptypes, $sub, undef); | |||||||||
| 61 | } | ||||||||||
| 62 | else { | ||||||||||
| 63 | 5 | ▶ | @_ or croak "too few keys"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 64 | 5 | my $ptypes = Sort::Key::Types::combine_types(@_); | |||||||||
| 65 | 5 | my $sub = Sort::Key::Types::combine_sub('@_', undef, @_); | |||||||||
| 66 | 5 | return _multikeysorter_inplace($ptypes, undef, $sub); | |||||||||
| 67 | } | ||||||||||
| 68 | } | ||||||||||
| 69 | |||||||||||
| 70 | 0 | ▶ | sub register_type { | ||||||||
|
Subroutine
register_type: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 71 | 0 | warn "Warning, Sort::Key API changed: register_type function has been moved to module Sort::Key::Types"; | |||||||||
| 72 | 0 | goto &Sort::Key::Types::register_type; | |||||||||
| 73 | } | ||||||||||
| 74 | |||||||||||
| 75 | |||||||||||
| 76 | 5 | 1; | |||||||||
| 77 | |||||||||||
| 78 | __END__ | ||||||||||