| 1 | 18 | ▶ | use v5.26; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 18 | ▶ | use Object::Pad; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 18 | ▶ | use Getopt::Pad::Type::Number; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | class Getopt::Pad::Type::Float :isa(Getopt::Pad::Type::Number) :strict(params) { | ||||||||||
| 7 | 18 | ▶ | use Scalar::Util qw(looks_like_number); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 18 | our $VERSION = '0.05'; | |||||||||
| 10 | |||||||||||
| 11 | 18 | ▶ | use constant NAMES => ['f', 'float', 'num', 'number']; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 4 | ▶ | method checkFormat($value) { | ||||||||
|
Subroutine
checkFormat: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 14 | 4 | ▶ | return sprintf("'%s' is not a number", $value) if !looks_like_number($value); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 3 | ▶ | return sprintf("'%s' is not a finite number", $value) if $value =~ /\A\s*[+-]?(?:inf(?:inity)?|nan)\s*\z/i; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 1 | return undef; | |||||||||
| 17 | 18 | } | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 18 | 1; | |||||||||
| 21 | |||||||||||
| 22 | __END__ | ||||||||||