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

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

Thread Previous | Thread Next
Ilya Zakharevich
March 16, 2000 16:44
Re: [ID 20000316.002] Math::BigInt and string ops
Message ID:
Matthias Urlichs writes:
> print "$obj\n"
> $obj =~ s/^+//;
> print "$obj\n",ref($obj),"\n";
> ^D
> yields:
> +123456
> +123456
> [ 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.

No weird stuff.  This was already reported.  RExen do not reliably
work on references.

The quickiest dirtiest fix is to upgrade an SV to PVIV, and put a
correct SvCUR when a string value of a reference is calculated.  Put
this inside


so that it can be easily found and removed when a better fix comes.

No-dirty fix would take some time, which I do not have now.


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