in reply to Re: Detecting if a script uses non-standard module
in thread Detecting if a script uses non-standard module
All modules are stored in directories contained in the @INC variable. It is not hard to create a perl script to find all modules within those directories. The easiest involves using glob, i.e.:
foreach my $path (@INC) { my @modules = glob "$path/*.pm"; foreach my $module (@modules) { print "You have module $module installed\n"; } }
A more elegant solution would involve using File::Find to recursively search the directories, and create the proper names for modules. (For instance, the Net::SMTP module would be called SMTP.pm under the directory Net)
Want to support the EFF and FSF by buying cool stuff? Click here.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Detecting if a script uses non-standard module
by davido (Cardinal) on Apr 05, 2004 at 05:03 UTC | |
by Vautrin (Hermit) on Apr 05, 2004 at 16:20 UTC |
In Section
Seekers of Perl Wisdom