I came across Inf (and friends) some years ago, decided they all looked somewhat flakey, and haven't used them since. Your posting has (somewhat) piqued my interest again. Here's some interesting results from Scalar::Util's looks_like_number() function.
$ perl -E ' use Scalar::Util qw{looks_like_number}; my @infs = (inf, Inf, INF, infinity, Infinity, INFINITY, -inf, -Inf, -INF, -infinity, -Infinity, -INFINITY, Inftyddssssd, infighting, Infighting, -Inftyddssssd, -infighting, -Infighting); say "$_ : ", looks_like_number($_) for @infs; ' inf : 20 Inf : 20 INF : 20 infinity : 20 Infinity : 20 INFINITY : 20 -inf : 28 -inf : 28 -inf : 28 -inf : 28 -inf : 28 -inf : 28 Inftyddssssd : 0 infighting : 0 Infighting : 0 -Inftyddssssd : 0 -infighting : 0 -Infighting : 0
I also noted that the documentation for this function links to perlapi - looks_like_number, which may be of interest ot you.
-- Ken
In reply to Re^3: Incrementing "Infinity" bug
by kcott
in thread Incrementing "Infinity" bug
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |