Purity bugfix in CPANdeps: argh /x!

drhyde on 2008-12-11T15:38:07

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.


\s or \x20

chorny on 2008-12-11T17:41:35

it's "\ "

Re:\s or \x20

Aristotle on 2008-12-13T17:12:39

I prefer [ ].