in reply to Retaining hash order with Config::General?
While I am not familiar with the Config::General you are working with, a fundamental property of hashes is that order of key-value pairs should be irrelevant. Do you care about the order for some internal reason, or is this about the order in the saved file?
Update: The Config::General->save_file method calls the _store method, which in turn traverses the hash with a keys method on line 1252. There also appears to be a save sorted version of the same loop, which you can use by setting the -SaveSorted flag and will reliably output your keys in alphabetical order. It still doesn't change the fact that a hash's order should be irrelevant.
Update 2: Forward/backward slash typo. Thanks Arunbear.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Retaining hash order with Config::General?
by bart (Canon) on Dec 15, 2008 at 17:31 UTC | |
by Anonymous Monk on Dec 15, 2008 at 21:18 UTC | |
|
Re^2: Retaining hash order with Config::General?
by Anonymous Monk on Dec 15, 2008 at 16:49 UTC | |
by jeffa (Bishop) on Dec 15, 2008 at 17:03 UTC | |
by Anonymous Monk on Dec 16, 2008 at 11:31 UTC | |
by kennethk (Abbot) on Dec 15, 2008 at 17:08 UTC |