toma has asked for the wisdom of the Perl Monks concerning the following question:
I am wondering if there is a simple way to find the file location so that I can open it. Here is what I am doing, and it works, but it looks strange to me, like maybe I am missing a more obvious or general technique.
Is there a better way?my $module_fn= $INC{'MyModule.pm'}; my ($vol, $dir, $fn)= File::Spec->splitpath($module_fn); my $the_modules_file= $dir.'myfile';
I need something that works with all the typical ways of using the module, for example having it in a directory specified in $PERL5LIB.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Finding a file associated with a module
by merlyn (Sage) on May 08, 2004 at 10:08 UTC | |
|
Re: Finding a file associated with a module
by PodMaster (Abbot) on May 08, 2004 at 06:52 UTC | |
|
Re: Finding a file associated with a module
by Abigail-II (Bishop) on May 08, 2004 at 08:33 UTC | |
|
Re: Finding a file associated with a module
by eXile (Priest) on May 08, 2004 at 15:33 UTC | |
|
Re: Finding a file associated with a module
by VSarkiss (Monsignor) on May 09, 2004 at 17:08 UTC |