in reply to Determining presence of odd number of hash elements, other syntax problems
If this is a nested hash, I'd also check for use of refs (or objects) as the hash key.
On a related note, can anyone suggest a way of determining the location of the offending problem(s)?Well, the best I can think of is to use diff to compare the source before and after. If it worked before, the error lust be in what changed.
Also: you may want to apply stricter rules to the format of the source code, than perl allows. For example, you could demand that new keys for the hash are always on a new line.
Perhaps you can build a validator for rules like these, using PPI? Don't spend too much time on it, or it might be faster to convert this to a database. Which is what I'd really recommend. (Maintain the contents with a generic CRUD tool, maybe build one with a CRUD builder toolkit; and access the DB contents with DBIx::Simple/SQL::Abstract, which is my preferred way to exchange data between Perl and an SQL DB.)
|
|---|