in reply to Re^2: cpan smokers, PREREQ_PM, and PDL dependency (perl-reversion)
in thread cpan smokers, PREREQ_PM, and PDL dependency

I don't think it looks for arbitrary numbers. Reading through the source, it seems to look for things like VERSION followed by something that looks like a version number.

I guess a good workaround could be to use:

BEGIN { my $VERSION; $VERSION = 1.02; use_ok('Some::Module', 1.02); };

... but then, I'm not sure what the use of use_ok is anyway. The test will crash if use_ok fails, but if it fails, there is little sense to continue anyway :)

Replies are listed 'Best First'.
Re^4: cpan smokers, PREREQ_PM, and PDL dependency (perl-reversion)
by toolic (Bishop) on Nov 19, 2015 at 18:01 UTC
    Thanks for the reply. I looked at other open patches, and I think I created one for myself:
    sub version_re_test { my $ver_re = shift; return qr{ ^ ( .*? use_ok .*? ) $ver_re ( .* \s*) \z }x; }
    I'll test it out, and if it works, I might upload it to RT. Yeah, I'm wondering if use_ok adds any value myself. I thought this was the standard way to test the VERSION variable. Is there another standard way?