Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!lll-winken!uunet!aspect!dave From: dave@aspect.UUCP (Dave Corcoran) Newsgroups: comp.lang.perl Subject: Need clarification of assoc. arrays Keywords: arrays help Message-ID: <7457@aspect.UUCP> Date: 28 Jan 91 22:09:25 GMT Distribution: usa Organization: Aspect Telecommunications, San Jose, Ca Lines: 33 printf("Hello world\n"); Why is does this script: perl -e ' $keyword{"one"}="ONE"; $keyword{"two"}="TWO"; for $i (%keyword) { print $i; }' yield twoTWOoneONE and not onetwo I am trying to print the indices and the contents of the array thus: for $i (%keyword) { printf "the index is %s; the contents are %s\n",$i,$keyword{$i}; } Please enlighten me, I'm using the perl 3.0 (I have not access to the patch program). -- David Corcoran -@@ uunet!aspect!dave ~ In a society where anything goes eventually everything will.