That's dependent on the Module and its 'import' routine.

If I use an 'import' routine that looks for a version number (regardless of whether it has been stringified or not) it can compare them as version numbers.

As an example, download 'Xporter' from cpan and place it in the module, and then call the module -- you'll see that it flags an error.

You could argue that version strings should have some other use, but I'd much prefer something that looks like a version string be given preference to being interpreted as a version string.

I've yet to see any module accept a version-looking string as an argument. Not to say one couldn't exist, but it breaks the 'least astonishment' design principle, for the same expression to be taken as a version number in the module, but not in the useing module.

Obviously someone felt differently when designing the versions, but do you know of any modules that use a version looking string as an argument in a use module statement?

Looking at the link of anon-monk, I see the example using single quotes in the $VERSION statement, a recommendation against using v-strings and a use of a bare version number with 'use'.

I don't see why it is that way.


In reply to Re^2: VERSION format & compare by perl-diddler
in thread VERSION format & compare by perl-diddler

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.