in reply to Re: Infinity and Inf?
in thread Infinity and Inf?

> It's not a symbol (not a constant or function).

hmm strange:

DB<8> print 5+Inf inf DB<9> use strict;print 5+Inf Bareword "Inf" not allowed while "strict subs" in use at (eval 13)[/us +r/share/perl/5.10/perl5db.pl:638] line 2.

Cheers Rolf

Replies are listed 'Best First'.
Re^3: Infinity and Inf?
by ikegami (Patriarch) on Aug 31, 2010 at 18:02 UTC
    How is that weird? Barewords are autoquoted when strict doesn't prevent it.
    $ perl -E'$x=abc; say $x' abc $ perl -E'$x=Inf; say $x' Inf

    Nothing special there. Like I said, only its numification is special.

    $ perl -E'$x=Inf; say 0+$x' inf
      > How is that weird?
      DB<10> print 5+abc 5 DB<11> print 5+Inf inf

      So Inf is a kind of dualvar but not a constant?

      Strange...

      Cheers Rolf

        You find it strange that "abc" numifies to zero?

        So Inf is a kind of dualvar but not a constant?

        No. Like I said in my last two posts, "Inf" (numifies to inf) is a string just like "5" (numifies to 5), "abc" (numifies to 0) and "5E1" (numifies to 50).