in reply to Please suggest the best way .ini or pm

The beauty of Perl is that there are many different ways to achieve your goal.

There is no "true and unique" way to do it, it all depends on so many different factors.

Personally, I am in favour of using an external configuration file (I really like YAML) in case there is some configuring to be done and this configuration changes from time to time or place to place. Also it is less "risky" to give users access to the configuration file rather than allowing them to edit the module or script directly.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics
  • Comment on Re: Please suggest the best way .ini or pm

Replies are listed 'Best First'.
Re^2: Please suggest the best way .ini or pm
by vinoth.ree (Monsignor) on Jun 26, 2015 at 06:35 UTC
    ++CountZero

    I am second to you, we always keep database configuration in YAML file. So whenever the program starts it read the database configurations from yaml file and process the test cases.

    It will be useful if you keep database configuration in YAML, the code can be shared with other so that they can easily change only the yaml file, instead of finding them in .pm file


    All is well. I learn by answering your questions...