develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [ID 20000316.002] Math::BigInt and string ops

Thread Previous | Thread Next
Unknown Sender
March 16, 2000 14:21
Re: [ID 20000316.002] Math::BigInt and string ops
Message ID:

> >Is it the s/^\+// that's broken?
> No, it's that if you try to initialize a bigint to "0.5", you get

Sorry -- different problem.

I wasn't trying to initialize a bigint to 0.5. Consider this:

$ perl -MMath::BigInt
$obj = new Math::BigInt 123456;
print "$obj\n"
$obj =~ s/^+//;
print "$obj\n",ref($obj),"\n";

[ empty line ]

Thus, $obj is no longer a Math::BigInt object (which is to be expected),
BUT the substitution hasn't happened. There's some weird interaction with
overlaid '""' which in effect trashes the result of s/// in this case.

Matthias Urlichs  |  noris network GmbH   |  |  ICQ: 20193661
The quote was selected randomly. Really.    |
       One who's afraid to tell his pregnant wife that he's sterile.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About