Subject: | Changes to Perl coming in 5.13.9 cause Mongo to no longer compile |
Perl is changing in the 5.13 series to have several what we are calling
"character sets" for regular expressions to operate under. Previously
there was just locale vs non-locale, with the latter matching using
Unicode semantics when the target string is utf8, and under certain
other circumstances.
The new paradigm is to have locale; unicode (always use Unicode
semantics); ascii_restricted (like unicode, but matches of \d, \s, \w,
and the [:posix:] character classes are restricted to ascii characters
only; and finally 'depends', which works the old way in which the
matching semantics depends on the utf8ness of the target string. I
expect to add yet another one in the next week or so that is like the
restricted-ascii one, but has even more restrictions. It is planned for
Perl 5.14.0 to include all these.
What this means to Mongo is that the flag bit that said whether the
regex was using locale or not is insufficient, and has been removed
(which is why Mongo won't compile) and replaced by a simple API to get
and set the "character set" of a regular expression.
In the file perl_mongo.c, there are currently these lines:
switch(*(buf->pos)) {
case 'l':
flags |= PMf_LOCALE;
break;
These could be replaced by these to get it to compile:
switch(*(buf->pos)) {
case 'l':
set_regex_charset(flags, REGEX_LOCALE_CHARSET);
break;
but I don't know enough about your application to know if that's all you
want to do given the other new character sets.
If Mongo needs to operate with both the old and new Perls, a
#ifdef PMf_LOCALE
could be used to decide which of the paradigms to operate under.
If you need further clarification, etc, please email me.