develooper Front page | perl.perl5.porters | Postings from December 2011

[perl #99026] /(??{...})/ failure/corruption when using 'use bigint;'

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
December 6, 2011 03:55
Subject:
[perl #99026] /(??{...})/ failure/corruption when using 'use bigint;'
Message ID:
rt-3.6.HEAD-5084-1323172531-1567.99026-15-0@perl.org
On Tue Sep 13 08:17:35 2011, jerry@nightwatch.org.uk wrote:

> 
>         "03abcde" =~ /^(..)((??{sprintf".{%d}",hex("0x$1")}))/;
>         print "$`:$&:$' -> [$1] [$2]\n"
> 
> Run the same code with 'use bigint;':
> 
>         use bigint;
>         "03abcde" =~ /^(..)((??{sprintf".{%d}",hex("0x$1")}))/;
>         print "$`:$&:$' -> [$1] [$2]\n"
> 
> and the RE doesn't match and $' is filled with garbage, which would
>    appear to
> be the memory of the process.
> 

I get a somewhat different result.

###
"03abcde" =~ /^(..)((??{sprintf".{%d}",hex("0x$1")}))/;
print "$`:$&:$' -> [$1] [$2]\n";

use bigint;
"03abcde" =~ /^(..)((??{sprintf".{%d}",hex("0x$1")}))/;
print "$`:$&:$' -> [$1] [$2]\n";
###

... produces:

###
:03abc:de -> [03] [abc]
Use of uninitialized value $2 in concatenation (.) or string at 99026.pl
line 13.
:03abc:de -> [03] []
###

... i.e., no garbage, but no good results either.  (Perl 5.14.2/Linux i386)

Thank you very much.
Jim Keenan

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