Code Comments
Programming Forum and web based access to our favorite programming groups.How do I test if a particular module is loaded on my system? Bunny
Post Follow-up to this messageBunny (bunny1112@yahoo.com) wrote:
> How do I test if a particular module is loaded on my system?
That depends on how you interpret that question:
To test whether a module has already been loaded into an application,
consult the %INC hash (where the keys are module_names mangled with
{ $module_name =~ s|::|/|g; $module_name .= '.pm'; } and the value
are the full path to the module).
To test whether a module has been installed, enter
% perl -M<module> -e 1
If you get "Can't locate <module>.pm in @INC (@INC contains ...)"
the module is not installed.
cu,
Martin
--
So long, and thanks | Martin Vorlaender | OpenVMS rules!
for all the books... | work: mv@pdv-systeme.de
In Memoriam Douglas Adams | http://www.pdv-systeme.de/users/martinv/
1952-2001 | home: martin@radiogaga.harz.de
Post Follow-up to this messageOn 2004-03-20, Bunny <bunny1112@yahoo.com> wrote: > How do I test if a particular module is loaded on my system? rv = eval "require Module::Foo"; -- --Arthur Corliss Bolverk's Lair -- http://arthur.corlissfamily.org/ Digital Mages -- http://www.digitalmages.com/ "Live Free or Die, the Only Way to Live" -- NH State Motto
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.