develooper Front page | perl.perl5.porters | Postings from November 1999

Re: Regex match variables, threads, and recursion

Thread Previous | Thread Next
From:
Gurusamy Sarathy
Date:
November 5, 1999 10:15
Subject:
Re: Regex match variables, threads, and recursion
Message ID:
199911051821.KAA05652@activestate.com
On Fri, 05 Nov 1999 12:54:47 EST, Dan Sugalski wrote:
>	$search_string = "123abc";
>
>	sub foo {
>	    $again = shift;
>	    $search_string =~ /(\d+)(\w+)/;
>	    print "$1 $2\n";
>	    return unless $again;
>	    $search_string = "456def";
>	    foo(0);
>	    print "$1 $2\n";
>	}
>
>	foo(1);
>
>produces:
>
>123 abc
>456 def
>456 def
>
>I don't recall seeing this documented anywhere, though it very well might be.

Known bug.  See:
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1998-11/msg00648.html

Ilya, this is a _serious_ bug in regular expressions, and I'm sad to
see that it hasn't been fixed in more than a year.  I have half a
mind to be cruel and "motivate" fixing it by not accepting any RE
patches until this is fixed. :-}


Sarathy
gsar@ActiveState.com

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