[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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