8
I'm trying to write a test for this bug. I've already found a solution to the bug; what I can't understand is why my tests didn't catch the bug before release.
The problem boils down to this command line printing Ver: 0 when it's supposed to print Ver: 1.00:
perl -Mversion -e 'printf "Ver: %s\n", ("v1.00" =~ /v(.+)/ ? version->parse($1) : "no");'
However, if you insert -MTest::More before -Mversion, then it prints Ver: 1.00.
So my question is why does loading Test::More change the behavior of my code? (For bonus points, why does using "$1" instead of $1 eliminate the bug?)
I'm using Perl 5.14.2, Test::More 0.98, and version 0.88.