That's not the way associative arrays work. They are stored differently.
If you want them to be printed in a certain order, then you must do it
explicitly. I think it is really better to think of it as a hash instead of
an associative array for that reason. Not all of the rules apply. I
commonly use a snippet of code like this when I'm printing hashes:
foreach(sort keys %hash){
print $hash{$_};
}
-----Original Message-----
From: P. S. Starkey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: associative array not looking like I thought it would
I have some perl script (shown below) and I am wondering why the associative
array being built ends up looking like the printout of the array as shown
after the code. I would have assumed the array entries would have been
shown in the same order they are put into the array but that is not
happening.
%Error=( Error=>"[$ciTDF{'#errval_V'}]: $ciTDF{'#errtext_V'}",
"Document Name"=>$ciTDF{'DOC_NAME_V'},
Revision=>$ciTDF{'DOC_REV_V'},
Desc=>"Issuing-could not index to vault",
Notes=>"Clean Vault Log");
DB<3> p %Error
Document NamePARRYTESTERR12NotesClean Vault LogError[142]: BCI Err : More
than one match for a record in the BEF input fileDescIssuing-could not index
to vaultRevision1
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]