hookbot has asked for the wisdom of the Perl Monks concerning the following question:
but when I upgrade from 5.005 to 5.6.0, everything hangs. How can this happen, and why was this bug installed into Perl? Is it an attempt to punish people for using regex's styles that are supposedly depricated or something? I would think that most old perl code should also work on the new perl, and, at least, any pattern match with a "g" option should not cause an infinite loop, eh?perl -e '$_ = "a"; while (m/(?:\G|^)(a)/g) {print "[$1]\n";}'
BTW, I just changed to this and it works on both perls:
perl -e '$_ = "a"; while (m/\G(a)/g) {print "[$1]\n";}'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(bbfu) Re: Infinite m//g ??
by bbfu (Curate) on May 02, 2001 at 02:17 UTC | |
|
Re (tilly) 1: Infinite m//g ??
by tilly (Archbishop) on May 03, 2001 at 06:47 UTC |