Home > Archive > PERL Modules > January 2008 > Finding installed modules
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Finding installed modules
|
|
| Bernie Cosell 2008-01-08, 10:04 pm |
| I was poking around at scripts to locate all installed modules and I'm a
little [or else I'm missing something]. *every* script I found
after a quick Google uses File::Find on @INC, but that seems wrong: my
guess [verified by a quick test pgm] is that 'use' does *NOT* search
subdirectories.
So: Is there some trick I'm not seeing in using File::Find to *prevent* it
from descending into subdirectories or is it really correct to do a
recursive search off of @INC to find modules??
[Assuming my guess here is correct, it looks to me like a better scheme is
just to use opendir/readdir to locate installed modules rather than ::Find,
no?]
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
| |
| Gunnar Hjalmarsson 2008-01-08, 10:04 pm |
| Bernie Cosell wrote:
> I was poking around at scripts to locate all installed modules and I'm a
> little [or else I'm missing something]. *every* script I found
> after a quick Google uses File::Find on @INC, but that seems wrong: my
> guess [verified by a quick test pgm] is that 'use' does *NOT* search
> subdirectories.
Well, let's take an example. If @INC contains the path
/usr/lib/perl5/5.8.6 and Find.pm is located in
/usr/lib/perl5/5.8.6/File, how would 'use' find the File::Find module
without looking in the subdirectories?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
| |
| Bernie Cosell 2008-01-08, 10:04 pm |
| Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
} Bernie Cosell wrote:
} > I was poking around at scripts to locate all installed modules and I'm a
} > little [or else I'm missing something]. *every* script I found
} > after a quick Google uses File::Find on @INC, but that seems wrong: my
} > guess [verified by a quick test pgm] is that 'use' does *NOT* search
} > subdirectories.
}
} Well, let's take an example. If @INC contains the path
} /usr/lib/perl5/5.8.6 and Find.pm is located in
} /usr/lib/perl5/5.8.6/File, how would 'use' find the File::Find module
} without looking in the subdirectories?
Yeah, I realized that right after I posted my inquiry. The key part is to
use ::Find with "nochdir" so you can reconstruct the proper '::' name for
the subdirectoried [is that a word? :o)] modules.
Thanks! /bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
| |
|
|
|
|
|