--- Chris Devers <[EMAIL PROTECTED]> wrote:
> On Thu, 9 Mar 2006, Ron Smith wrote:
>
> > How can I assure printing the correct order?
>
> You can't guarantee the order of keys in a hash per
> se. For efficiency
> and optimization, hashes are stored in a random
> order, unlike arrays,
> which do have a straightforward order.
>
> The trick then is to sort the hash keys. Instead of
> this:
>
> > foreach ( keys( %values ) ) {
>
> Try this, or a variant on this:
>
> foreach ( sort keys( %values ) ) {
>
> You can get more sophisticated than this, but doing
> at least this much
> sorting on the keys should start producing
> consistent results.
>
Yes, I had though of doing this, but wasn't sure if
the values were being saved or accumulated. So, this
brings me to a key concept I'm unclear on.
Am I correct in saying that the values appended to
$data are accumulated each time values are entered;
therefore the values in %values are too?
>
> --
> Chris Devers
> DO NOT LEAVE IT IS NOT REAL
>
Ron Smith
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>