Link to home
Start Free TrialLog in
Avatar of Kim Ryan
Kim RyanFlag for Australia

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.
Avatar of ozo
ozo
Flag of United States of America image

use myconfig; #will automatically try all the entries in the @INC array for you
Avatar of Kim Ryan

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.
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
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks ozo, I can see that this works. As this is for a CPAN module (Lingua::EN::NameParse-1.00) 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.