Packing Perl Modules with Config Files?

I am currently creating a Perl module for home use. I used ExtUtils :: ModuleMaker to create a script assembly and skeleton for my Perl module. I would like to include the .ini configuration files that my core modules should work. Where do I put these files so that they are installed with my module? Which way do I need to use to access these configuration files through the main and additional modules?

PS this is a directory frame:

   |-lib
   |---Main.pm
   |---Main
   |-----subModule1.pm
   |-----subModule2.pm
   |-----subModule3.pm
   |-scripts
   |-t
+3
source share
3 answers

If you use Module :: Install, you can use Module :: Install :: Share and File :: ShareDir .

Module:: Build, config_data *:: ConfigData.

+4

Makefile, , lib/Main, ~/.modulerc, PERLLIB/Main/modulerc.ini - .

, ~/.modulerc .

+1

, . File::HomeDir. ~ ( ).

, rc . , . , , - .

Config::Any, . .

+1

Source: https://habr.com/ru/post/1711914/


All Articles