Inside your Makefile.PL, you have a WriteMakefile function. That function takes a list of key-value pairs which it will use to figure out what's going on and what to do when a user tries to install the module.

Inside that function, you should see an entry for PREREQ_PM => {}. This part allows you to specify all of the prerequisite modules along with their minimum versions. For example, this little snippet requires Foo::Bar version 1.02 or greater, Baz::Quux 2.70 or greater, and any version of CGI.pm.

WriteMakefile( #... PREREQ_PM => { Foo::Bar => 1.02, Baz::Quux => 2.70, CGI => 0, } #... );

Tools such as CPAN.pm and CPANPLUS can use this information to automatically install and update dependencies.

If you'd like to discover the module versions that you have installed, you can use a quick command line (among hundreds of other ways):

$ perl -MCGI -le 'print CGI->VERSION' 3.04

If you have the latest version (1.051.51) of my cpan(1) utility, you can use the -D switch to get module details. This is handy not only to check your installed version of the module, but to see what CPAN thinks is the current version.

$ cpan -D CGI CGI --------------------------------------------------------------------- (no description) L/LD/LDS/CGI.pm-3.15.tar.gz /usr/local/lib/perl5/5.8.4/CGI.pm Installed: 3.04 CPAN: 3.15 Not up to date Lincoln D. Stein (LDS) lstein@cshl.org

Good luck :)

--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

In reply to Re: How to create installable modules ? by brian_d_foy
in thread How to create installable modules ? by premak

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.