Monks,
I have found a bug in perl... version 5.6.0. Yeah, don't laugh.
Seriously though, the problem is minor, and was fixed in 5.6.1. Here's a script that exposes the problem:
use strict; use Data::Dumper; print "$]\n", Dumper([qw[ \\d ]]), "\n";
On 5.6.0 and 5.6.1, respectively, one gets:
# with 5.6.0 5.006 $VAR1 = [ '\\\\d' ]; # 5.6.1 5.006001 $VAR1 = [ '\\d' ];
The perldelta says of this:
qw(a\\b) In Perl 5.6.0, qw(a\\b) produced a string with two backslashes instead of one, in a departure from the behavior in previous versions. The older behavior has been reinstated.
Sooooo.... on testers.cpan.org the module now has an ugly FAIL blemish against it (or will have when the web page gets around to indexing the latest results). And I hate it when that happens.
The first release had a number of failures because I had my skip counts messed up if Test::Deep was not installed. So I fixed that, but I don't know how to fix this.
I have two ways forward, hence my questions: How can I specify, as a prerequisite, that the version of perl used must be anything except 5.6.0? With MakeMaker? Or with Module::Build, as I suppose I should switch to that?
Otherwise, if I read the delta correctlyl, I can work around the bug simply by:
s/\\\\/\\/g if $] eq '5.006'
...in the appropriate place and it should work (with a probable WARNING in large letters in the README and/or man page). Is this Robust and an example of something that does The Right Thing, or just plain stupid? I'm not really fussed about supporting 5.6.0. I'm just somewhat selfishly interested in having my module pass its test suites as much as possible.
(The module is Regexp::Assemble, in case you were interested).
update: heh heh, I've just had an evil thought. I could always skip the tests and throw up a big warning at that point if the test was being run with 5.6.0...
- another intruder with the mooring of the heart of the Perl
In reply to Working around a 5.6.0 bug by grinder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |