in reply to Re: How to create installable modules ?
in thread How to create installable modules ?

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' # prints: 3.04

Is there a similar trick for scripts installed from CPAN, such as cpan itself?

I ask because I just installed the latest Bundle::CPAN distro and, when I called perldoc -m cpan, I saw this:

# $Id: cpan,v 1.5 2005/12/24 00:59:08 comdog Exp $

... which leads me to believe that this is version 1.5, not version 1.05 as you suggest farther down in your posting.

(Or is this an artifact of the way you set your $VERSION?

my $VERSION = sprintf "%d.%02d", q$Revision: 296 $ =~ m/ (\d+) \. (\d+) /xg;

jimk

Replies are listed 'Best First'.
Re^3: How to create installable modules ?
by brian_d_foy (Abbot) on Jan 12, 2006 at 16:24 UTC

    There isn't a similar trick for scripts unless the script is specially written for it. It would need methods (so, it has to be class), and it would need one named VERSION.

    Don't be fooled by the CVS file revision number. The distro was cpan-1.5 (the latest is cpan-1.51) which I set in Makefile.PL. The 1.05 is a mistake.

    The latest cpan script has a -v switch, though. :)

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