[NTLUG:Discuss] Is a perl module installed?
kbrannen@gte.net
kbrannen at gte.net
Mon Dec 16 11:01:39 CST 2002
Bobby Wrenn wrote:
> How do I determine if a perl module (mason) is installed?
I like to do this:
perl -MHTML::Template -e 'print "$HTML::Template::VERSION\n"'
which gives me the version of what's installed if it's there ("2.2" in this
case). But when I try Mason,
perl -MHTML::Mason -e 'print "$HTML::Mason::VERSION\n"'
Can't locate HTML/Mason.pm in @INC (@INC contains:
/usr/lib/perl5/5.6.1/i586-linux /usr/lib/perl5/5.6.1
/usr/lib/perl5/site_perl/5.6.1/i586-linux /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl .).
BEGIN failed--compilation aborted.
which tells me it's not installed. You can write a shell script to do this
sort of thing, so that you only have to type in the module name once as an arg.
HTH,
Kevin
More information about the Discuss
mailing list