Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!icdoc!syma!sylvank From: sylvank@syma.sussex.ac.uk (Sylvan Katz) Newsgroups: comp.lang.perl Subject: assoc array Keywords: assoc array, keys, order Message-ID: <5102@syma.sussex.ac.uk> Date: 14 May 91 14:55:06 GMT Organization: University of Sussex Lines: 20 I have an application which requires that I initialize an associative array for counting purposes: EG: %matrix = ('A',0,'AA',0,'B',0,'BB',0); However, when I examine the order of the array elements with foreach $key (keys %matrix) { print "$key ";} I find order is BB A B AA Any suggestions on how I can PRESERVE the initial order (it is imperative for my applications) ? Sylvan sylvank@syma.sussex.ac.uk