| 1 | package Sort::Sub::numerically_no_warning; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||
| 8 | 1 | our $DATE = '2024-07-17'; # DATE | |||||||||
| 9 | 1 | our $DIST = 'Sort-Sub'; # DIST | |||||||||
| 10 | 1 | our $VERSION = '0.121'; # VERSION | |||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub meta { | ||||||||
|
Subroutine
meta: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 13 | return { | ||||||||||
| 14 | 0 | v => 1, | |||||||||
| 15 | summary => 'Sort numerically (without warning when comparing non-numbers)', | ||||||||||
| 16 | }; | ||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub gen_sorter { | ||||||||
|
Subroutine
gen_sorter: not called CC=1 SCAR=3.1
Pod
undocumented
| |||||||||||
| 20 | 0 | my ($is_reverse, $is_ci) = @_; | |||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub { | ||||||||
|
Subroutine
__ANON__: not called CC=4 SCAR=22.1
| |||||||||||
| 23 | 1 | ▶ | no strict 'refs'; ## no critic: TestingAndDebugging::ProhibitNoStrict | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 1 | ▶ | no warnings 'numeric'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | |||||||||||
| 26 | 0 | my $caller = caller(); | |||||||||
| 27 | 0 | ▶ | my $a = @_ ? $_[0] : ${"$caller\::a"}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | ▶ | my $b = @_ ? $_[1] : ${"$caller\::b"}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | |||||||||||
| 30 | 0 | my $cmp = $a <=> $b; | |||||||||
| 31 | 0 | ▶ | $is_reverse ? -1*$cmp : $cmp; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | }; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 1 | 1; | |||||||||
| 36 | # ABSTRACT: Sort numerically (without warning when comparing non-numbers) | ||||||||||
| 37 | |||||||||||
| 38 | __END__ | ||||||||||