Reputation: 87
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
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