I find this strange, because I was pretty sure that the only way to check the installed version of a module was to load it and call ->VERSION. There isn't any database of package versions within a perl installation that I know of. Are you sure that when you load the published version 3.03 and call ->VERSION it returns '3.03'?

Meanwhile, yes the CPAN tooling does manually parse out your version rather than evaling untrusted code. One thing I have done to solve similar problems (where I needed there to be a version for testing but was injecting the real version as dist build time) was put

# VERSION $MYPACKAGE::VERSION ||= '999';
So, let the real one come first, then apply one if it doesn't exist. Maybe just to be *really* sure tooling can't parse the bogus version, you could write it as a harder-to-parse expression, before 'use strict':
package MYPACKAGE; # VERSION ${ __PACKAGE__ . '::VER' . 'SION' } ||= 2**10; use strict;

Edit:

Oh! HAH, I remember now, I stopped doing that because I contributed the 'overwrite' option, which allows you to write

[OurPkgVersion] overwrite = 1
package MYPACKAGE; our $VERSION= '999'; # VERSION
and it just gets overwritten with the real version when released.

In reply to Re^3: Is VERSION > 999 allowed? by NERDVANA
in thread Is VERSION > 999 allowed? by jimav

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.