in reply to Reading from a flat text file database and storing contents in a hash
There are many different ways you could tackle this depending in large part how the configuration/data base file will be maintained. If you are writing a separate application to manage the file then you could use XML::Simple, Data::Dump::Streamer, a real data base using DBI and DBD::SQLite or a whole range of other options.
If your file format is XML or YAML there is a chance that it could be edited manually without breaking things, with YAML likely to be easier to get on with than XML.
Alternatively you could choose one of the plethora of configuration file formats (often Windows .ini style) and pick a module from CPAN to load it for you (there are many).
Or lastly, you could roll your own application specific file format and parse that. Code to do that using Perl is likely to be pretty small if you are even halfway smart about your file format and field separators.
The key question though is: hand edited or managed. Keep in mind that if you allow it to be hand edited, one day someone is going to screw it up.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading from a flat text file database and storing contents in a hash
by wishartz (Beadle) on Apr 20, 2007 at 12:23 UTC | |
by GrandFather (Saint) on Apr 20, 2007 at 12:38 UTC | |
by wishartz (Beadle) on Apr 20, 2007 at 12:36 UTC |