Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Printing a hash in a specific order?by artist (Parson) |
on Mar 15, 2003 at 15:06 UTC ( [id://243294]=note: print w/replies, xml ) | Need Help?? |
Hi L~R, you wrote: Unfortunately, the object is stored in a hash - and we know that the hash typically comes out differently than the order it went in. use Tie::IxHash - ordered associative arrays. Here is the sample:
From Description of the module: 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.
In Section
Seekers of Perl Wisdom
|
|