[Omaha.pm] perl -MTest::WWW::Mechanize::Catalyst\ 100

Jay Hannah jay at jays.net
Tue Aug 5 17:46:37 PDT 2008


Here's a neat way of figuring out what version of any given module  
you have. For example, if I tell Perl that I require  
Test::WWW::Mechanize::Catalyst version 100 it will fail and report to  
me what version I actually have:


$ perl -MTest::WWW::Mechanize::Catalyst\ 100
Test::WWW::Mechanize::Catalyst version 100 required--this is only  
version 0.42.
BEGIN failed--compilation aborted.


Pretty slick, eh?  Thanks to rjbs @ YAPC & IRC.  :)

(This trick isn't nearly as cool as the DBI-specific magic below, but  
this trick works for ANY module.)

j



$ perl -MDBI -e 'DBI->installed_versions'
   Perl            : 5.008008    (i586-linux-thread-multi)
   OS              : linux       (2.6.16)
   DBI             : 1.601
   DBD::mysql      : 3.0002
   DBD::Sybase     : 1.08
   DBD::Sponge     : 12.010002
   DBD::SQLite     : 1.14
   DBD::Proxy      : 0.2004
   DBD::Informix   : 2007.0914
   DBD::Gofer      : 0.010103
   DBD::File       : 0.35
   DBD::ExampleP   : 12.010007
   DBD::DBM        : 0.03



More information about the Omaha-pm mailing list