Thursday December 11, 2008
Purity bugfix in CPANdeps: argh /x!
Lyle pointed me at a bug in CPANdeps when you tell it to report on whether modules are "pure perl" or not. It got it wrong for Finance::IIF. I eventually tracked it down to this code in the parser for MANIFEST files
... =~ / ...( |$)/ix
which looks for some stuff, followed by either a space or the end of a line. It uses /x so I can break the regex over multiple lines and have comments in it. But of course, /x makes the regex parser not only ignore those extra newlines and the leading spaces I put on the following lines so that my code is nicely indented, it also makes it ignore that rather important space that I actually want to look for. Gragh! Replaced it with \s. Which was, of course, wrong, as \s also matches (some) end of lines. So now it's \x20.