Mohima Chaudhuri
Mohima Chaudhuri

Reputation: 87

perl config file

I am trying to create a settings file/configuration file. This would contain a list of key value pairs. There are 10 scripts that would be using this configuration file,either taking the input from it or sending output to it(key-values) or both.

I can do this by simply reading from and writing to the file..but I was thinking about a global hash in my settings file which could be accessed by all 10 scripts and which could retain the changes made by each script. Right now,if I use : require "setting.pl" I am able to change the hash in my current script,but in the next script the changes are not visible..

Is there a way to do this?Any help is much appreciated.

Upvotes: 2

Views: 1105

Answers (3)

Sopan
Sopan

Reputation: 691

Check out this module, AppConfig.

Upvotes: 2

Alan Curry
Alan Curry

Reputation: 14711

How about a config file tied to a hash?

Upvotes: 2

Danil Onishchenko
Danil Onishchenko

Reputation: 2040

I think you need some kind of database. You can either use mysql/sqlite/etc or create a distinct script which keeps your hash and provides read/write access to it with sockets.

Upvotes: 1

Related Questions