note
artist
Hi [L~R],<BR>
you wrote:<br>
<i>Unfortunately, the object is stored in a hash - and we know that the hash typically comes out differently than the order it went in. </i><p>
use [cpan://Tie::IxHash] - ordered associative arrays.
Here is the sample:
<p>
<code>
# Prints this without tie:
# apples
# oranges
#
# Prints this with tie:
# oranges
# apples
use Tie::IxHash;
tie %menu, 'Tie::IxHash';
$menu{oranges} = 1;
$menu{apples} = 2;
foreach (keys %menu)
{
print "$_\n";
}
</code>
From Description of the module:<BR>
This Perl module implements Perl hashes that preserve the order in which the hash elements were added. The order is not affected when values corresponding to existing keys in the IxHash are changed. The elements can also be set to any arbitrary supplied order. The familiar perl array operations can also be performed on the IxHash.
<P>
[artist]
243290
243290