On Thu, 2006-10-05 at 02:49 +0000, zhihua li wrote:

> I've a question about installed modules in perl. To get an idea as to 
> weather or not a specific module (say A.pm) is present in my perl I can 

If you are using bash, here's a handy alias I made you can put in your .bashrc 
file:

alias modver="perl -e\"eval qq{use 
\\\$ARGV[0];\\\\\\\$v=\\\\\\\$\\\${ARGV[0]}::VERSION;};\
  [EMAIL PROTECTED] module found\\n}:\\\$v?qq{Version 
\\\$v\\n}:qq{Found.\\n};\"\$1"

(it's two lines in case your mailer wraps: second line starts with "print").

Usage examples:

$ modver DBD::Pg
Version 1.49

$ modver Acme::Dynamite
No module found

$ modver Data::Dumper
Version 2.121


-- 
Greg Sabino Mullane [EMAIL PROTECTED] [EMAIL PROTECTED]
End Point Corporation
PGP Key: 0x14964AC8 200610051111
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to