develooper Front page | perl.perl5.porters | Postings from July 2008

Re: [perl #57244] crash with recursive regexp

Thread Previous | Thread Next
From:
Eric Brine
Date:
July 25, 2008 00:26
Subject:
Re: [perl #57244] crash with recursive regexp
Message ID:
f86994700807250025y7d219f55j2f46c100f010e069@mail.gmail.com
On Thu, Jul 24, 2008 at 8:32 AM, via RT Zefram
<perlbug-followup@perl.org> wrote:
> $ cat x1.pl
> use re "eval";
> my $dqstring_rx = qr/"(?:[^"\\]+|\\(?:e|x\{([0-9a-fA-F]+)\}))*"/;
> my $sqstring_rx = qr/'(?:aaa|bbb)'/;
> my $string_rx = qr/$dqstring_rx|$sqstring_rx/o;
> my $array_rx = qr/\[(??{$datum_rx}),*\]/o;          <-- $datum_rx refers to $main::datum_rx
> my $datum_rx = qr/$string_rx|$array_rx/o;
> "['aaa','bbb',]" =~ /\A$array_rx\z/;

That should be

my $datum_rx;
my $array_rx = qr/\[(??{$datum_rx}),*\]/o;
$datum_rx = qr/$string_rx|$array_rx/o;

but that's not related to the bug in Perl.

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