in reply to Printing a hash in a specific order?
use Tie::IxHash - ordered associative arrays. Here is the sample:
From Description of the module:# 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"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Printing a hash in a specific order?
by Limbic~Region (Chancellor) on Mar 15, 2003 at 15:15 UTC | |
by artist (Parson) on Mar 15, 2003 at 15:44 UTC |