App-Dex
view release on metacpan or search on metacpan
scripts/dex view on Meta::CPAN
tag => 'tag:yaml.org,2002:float',
match => [ equals => $_ => 0 + "inf" ],
) for (qw/ .inf .Inf .INF +.inf +.Inf +.INF /);
$schema->add_resolver(
tag => 'tag:yaml.org,2002:float',
match => [ equals => $_ => 0 - "inf" ],
) for (qw/ -.inf -.Inf -.INF /);
$schema->add_resolver(
tag => 'tag:yaml.org,2002:float',
match => [ equals => $_ => 0 + "nan" ],
) for (qw/ .nan .NaN .NAN /);
$schema->add_resolver(
tag => 'tag:yaml.org,2002:str',
match => [ all => sub { $_[1]->{value} } ],
);
my $int_flags = B::SVp_IOK;
my $float_flags = B::SVp_NOK;
$schema->add_representer(
flags => $int_flags,
code => \&represent_int,
scripts/dex view on Meta::CPAN
code => \&represent_float,
);
$schema->add_representer(
undefined => \&represent_undef,
);
$schema->add_representer(
equals => $_,
code => \&represent_literal,
) for ("", qw/
true TRUE True false FALSE False null NULL Null ~
.inf .Inf .INF +.inf +.Inf +.INF -.inf -.Inf -.INF .nan .NaN .NAN
/);
$schema->add_representer(
regex => qr{$RE_INT_CORE|$RE_FLOAT_CORE|$RE_INT_OCTAL|$RE_INT_HEX},
code => \&represent_literal,
);
if ($schema->bool_class) {
$schema->add_representer(
class_equals => $schema->bool_class,
code => \&represent_bool,
scripts/dex view on Meta::CPAN
#https://yaml.org/type/bool.html
# y|Y|yes|Yes|YES|n|N|no|No|NO
# |true|True|TRUE|false|False|FALSE
# |on|On|ON|off|Off|OFF
# https://yaml.org/type/float.html
# [-+]?([0-9][0-9_]*)?\.[0-9.]*([eE][-+][0-9]+)? (base 10)
# |[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+\.[0-9_]* (base 60)
# |[-+]?\.(inf|Inf|INF) # (infinity)
# |\.(nan|NaN|NAN) # (not a number)
# https://yaml.org/type/int.html
# [-+]?0b[0-1_]+ # (base 2)
# |[-+]?0[0-7_]+ # (base 8)
# |[-+]?(0|[1-9][0-9_]*) # (base 10)
# |[-+]?0x[0-9a-fA-F_]+ # (base 16)
# |[-+]?[1-9][0-9_]*(:[0-5]?[0-9])+ # (base 60)
# https://yaml.org/type/null.html
# ~ # (canonical)
scripts/dex view on Meta::CPAN
tag => 'tag:yaml.org,2002:float',
match => [ equals => $_ => 0 + "inf" ],
) for (qw/ .inf .Inf .INF +.inf +.Inf +.INF /);
$schema->add_resolver(
tag => 'tag:yaml.org,2002:float',
match => [ equals => $_ => 0 - "inf" ],
) for (qw/ -.inf -.Inf -.INF /);
$schema->add_resolver(
tag => 'tag:yaml.org,2002:float',
match => [ equals => $_ => 0 + "nan" ],
) for (qw/ .nan .NaN .NAN /);
$schema->add_resolver(
tag => 'tag:yaml.org,2002:str',
match => [ all => sub { $_[1]->{value} } ],
implicit => 0,
);
my $int_flags = B::SVp_IOK;
my $float_flags = B::SVp_NOK;
$schema->add_representer(
flags => $int_flags,
scripts/dex view on Meta::CPAN
$schema->add_representer(
undefined => \&represent_undef,
);
$schema->add_representer(
equals => $_,
code => \&represent_literal,
) for ("", qw/
true TRUE True y Y yes Yes YES on On ON
false FALSE False n N n no No NO off Off OFF
null NULL Null ~
.inf .Inf .INF -.inf -.Inf -.INF +.inf +.Inf +.INF .nan .NaN .NAN
/);
$schema->add_representer(
regex => qr{$RE_INT_1_1|$RE_FLOAT_1_1|$RE_INT_OCTAL_1_1|$RE_INT_HEX_1_1|$RE_INT_BIN_1_1|$RE_SEXAGESIMAL_INT|$RE_SEXAGESIMAL},
code => \&represent_literal,
);
if ($schema->bool_class) {
$schema->add_representer(
class_equals => $schema->bool_class,
code => \&represent_bool,
scripts/dex view on Meta::CPAN
In scalar context, returns the number of elements that would have been
returned as a list.
Note that C<undef> is treated much as other numerical operations treat it; it
compares equal to zero but additionally produces a warning if such warnings
are enabled (C<use warnings 'uninitialized';>). In addition, an C<undef> in
the returned list is coerced into a numerical zero, so that the entire list of
values returned by C<uniqnum> are well-behaved as numbers.
Note also that multiple IEEE C<NaN> values are treated as duplicates of
each other, regardless of any differences in their payloads, and despite
the fact that C<< 0+'NaN' == 0+'NaN' >> yields false.
=head2 uniqstr
my @subset = uniqstr @values
I<Since version 1.45.>
Filters a list of values to remove subsequent duplicates, as judged by a
string equality test. Preserves the order of unique elements, and retains the
first value of any duplicate set.
( run in 0.320 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )