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

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

Thread Previous | Thread Next
From:
Ilya Zakharevich
Date:
March 16, 2000 16:44
Subject:
Re: [ID 20000316.002] Math::BigInt and string ops
Message ID:
200003170044.TAA23493@monk.mps.ohio-state.edu
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

#ifndef NO_DIRTY_FIX_FOR_REX_ENGINE_EXPECTING_SVCUR

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.

Ilya

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About