# 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"; }