in reply to How do I create/detect/handle Infinity?
I think in Perl 5 this is platform specific, so I'll rather give the Perl 6 answer:
my $num = Inf; given $num { say "+Inf" when Inf; say "-Inf" when -Inf; say "NaN" when NaN; }
Works in Rakudo today.
In Section
Seekers of Perl Wisdom