in reply to Probelm with priority printing (hash or by an array)
The sane approach would be to store the priority in the database with the rest of the information and obtain the list sorted by the priority.
If you can't do that, save the priorities in a hash, but reverse to what you show in your post:
then, given you have your data from db in an AoA, sort it using something like @sorted = sort({$priority{$$a[0]} <=> $priority{$$b[0]}} @list); (I expect the disease names in the first field here)%priority = ( Flu => 1, Cold => 1, ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Probelm with priority printing (hash or by an array)
by Anonymous Monk on Nov 07, 2008 at 12:12 UTC | |
by Anonymous Monk on Nov 07, 2008 at 13:51 UTC |