in reply to Re: number regex (incl sci notation)
in thread number regex (incl sci notation)

Scalar::Util's looks_line_number() routine checks the Perl API Looks Like Number field in the scalar.

In some cases your variable might have a string which is a valid number, but doesn't have that field set.

Replies are listed 'Best First'.
Re^3: number regex (incl sci notation) ("looks" not has IV)
by tye (Sage) on Dec 08, 2004 at 06:24 UTC

    There is no "looks like a number field" in a scalar. looks_like_number() checks whether a *string* *looks like a number*. This is independent of whether the scalar has an IV stored in it (which appears to be what you are thinking of).

    - tye