in reply to Re: Re: Managing Client Specific Hashes
in thread Managing Client Specific Hashes
Or if your array is large, and you want to save memory:my @a = ([ 1, 8], [ 9, 11], [ 20, 2], [ 22, 9], [ 31, 7], [ 38, 8], [ 46, 8], [ 54, 8], [ 62, 30], [ 92, 12], [104, 30]);
But if you look carefully, the "keys" aren't necessary at all - if all you do is process the data in order, the keys can be calculated from the values, and all you need to keep is:my @b = ( [1, 9, 20, 22, 31, 38, 46, 54, 62, 92, 104], [8, 11, 2, 8, 7, 8, 8, 8, 30, 12, 30] );
my @c = (8, 11, 2, 8, 7, 8, 8, 8, 30, 12, 30);
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Managing Client Specific Hashes
by Grygonos (Chaplain) on Jan 13, 2004 at 21:57 UTC |