Kim Ryan
asked on
Module config file
I am creating a module and I want some user settings to reside in a text file, which would live in the same directory as the module (.../site_perl/...). What is the easiest way to open the file from the module? I know I could try all the entries in the @INC array, but wondered if there is a siimpler approach.
use myconfig; #will automatically try all the entries in the @INC array for you
ASKER
Is myconfig a module I need to install? I can't seem to find any refernece to it.
"myconfig" was an example for the name of your user setting file which would live in the same directory as the module.
ASKER
Does this mean that I create a file called myconfig.pm and have it return a 1 (ie normal rules foe use statement?) I want my users to maintain a simple text file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks ozo, I can see that this works. As this is for a CPAN module (Lingua::EN::NameParse-1.0 0) I don't want the user to have more modules installed than necessary. I will loop over the @INC array anyway as it is fairly simple to do.