develooper Front page | perl.perl5.porters | Postings from February 2001

[BUG in 5.6.0] Re: FAIL YAPE-Regex-1.01 ppc-linux 2.2.14

From:
Jeff Pinyan
Date:
February 6, 2001 07:54
Subject:
[BUG in 5.6.0] Re: FAIL YAPE-Regex-1.01 ppc-linux 2.2.14
Message ID:
Pine.GSO.4.21.0102061051280.10766-100000@crusoe.crusoe.net
After studying the results of a failure of YAPE-Regex-1.01 to compile in
5.6, I've found a bug in Perl 5.6.0:

jeffp@hut [10:52am] YAPE-Regex-1.01 #163> perl -mre=debug
my $regex = qr/a/; print $regex =~ /^\(/;
__END__
Compiling REx `a'
size 3 first at 1
   1: EXACT <a>(3)
   3: END(0)
anchored `a' at 0 (checking anchored isall) minlen 1 

Compiling REx `^\('
size 4 first at 2
   1: BOL(2)
   2: EXACT <(>(4)
   4: END(0)
anchored `(' at 0 (checking anchored) anchored(BOL) minlen 1 
Guessing start of match, REx `^\(' against `(?-xism:a)'...
Not at start...
Match rejected by optimizer
Freeing REx: `a'
Freeing REx: `^\('

This problem goes away when I quote $regex:

jeffp@hut [10:52am] YAPE-Regex-1.01 #164> perl -mre=debug
my $regex = qr/a/;  print "$regex" =~ /^\(/;
__END__
Compiling REx `a'
size 3 first at 1
   1: EXACT <a>(3)
   3: END(0)
anchored `a' at 0 (checking anchored isall) minlen 1 
Compiling REx `^\('
size 4 first at 2
   1: BOL(2)
   2: EXACT <(>(4)
   4: END(0)
anchored `(' at 0 (checking anchored) anchored(BOL) minlen 1 
Guessing start of match, REx `^\(' against `(?-xism:a)'...
Guessed: match at offset 0
Matching REx `^\(' against `(?-xism:a)'
  Setting an EVAL scope, savestack=5
   0 <> <(?-xism:a)>      |  1:  BOL
   0 <> <(?-xism:a)>      |  2:  EXACT <(>
   1 <(> <?-xism:a)>      |  4:  END
Match successful!
Freeing REx: `a'
Freeing REx: `^\('
1

Has this been fixed in a previous patch?

-- 
Jeff "japhy" Pinyan     japhy@pobox.com    http://www.pobox.com/~japhy/
CPAN - #1 Perl Resource  (my id:  PINYAN)       http://search.cpan.org/
PerlMonks - An Online Perl Community          http://www.perlmonks.com/
The Perl Archive - Articles, Forums, etc.   http://www.perlarchive.com/




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