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.
LVL 19
Kim RyanIT ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
use myconfig; #will automatically try all the entries in the @INC array for you
0
Kim RyanIT ConsultantAuthor Commented:
Is myconfig a module I need to install? I can't seem to find any refernece to it.
0
ozoCommented:
"myconfig" was an example for the name of your user setting file which would live in the same directory as the module.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Kim RyanIT ConsultantAuthor Commented:
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.
0
ozoCommented:
use FindBin qw($Bin);
print "$Bin - path to bin directory from where script was invoked";

use $myconfig; #the filename you specified
print $INC{"$myconfig.pm"}; #the location of the file actually found
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kim RyanIT ConsultantAuthor Commented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.