[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] s/// Bug?



>I recently upgraded to MacPerl 5.1.9r4 and some of my code broke. Here is
>an example:
>
>  if (s/\n%BASE\s*(.*)//gi) {
>    $p{'BASE'} = $1;
>  }
>
>With 5.1.2, $1 had something in it. With 5.1.9 it's empty. I discovered
>that removing the 'g' modifier fixes the problem.
>
>My question is, is this a bug or bad coding on my part?

A few months back, I had a script break like this when I went to a more
recent version of MacPerl.  It too had a s/// construct, was used for
potentially very long strings, and had (.*) in it.  It broke only for
strings that got fairly long, so I suspected it was a problem with
amount of buffer space allocated internally for lookaheads or something
like that.   I ended up rewriting my code to split off pieces of the
string and not do such long lookaheads.

--
Paul DuBois
paul@snake.net
Home Page: http://www.primate.wisc.edu/people/dubois
Software:  http://www.primate.wisc.edu/software



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch