in reply to Changing the value of a BigInt?

Leaving Math::BigInt out of it, you can't have a scalar have a value like "0xdeadbeef" and have perl treat it as the number 0xdeadbeef; the "0x" header is noticed by the perl compiler when compiling a constant, and by things like Math::BigInt::new that explicitly do so, but when perl numifies a string variable, it only looks for decimal numbers. So "0xfoo" will only have the "0" part recognized as a number.

Is there a reason you can't say $predefbi = new Math::BigInt $firststr;?

Replies are listed 'Best First'.
Re: Re: Changing the value of a BigInt?
by hossman (Prior) on May 13, 2004 at 04:33 UTC
    Is there a reason you can't say $predefbi = new Math::BigInt $firststr; ?

    Or even...

    $predefbi = $strtcnt;