>>>>> "Michael" == Michael Stearman <[EMAIL PROTECTED]> writes:

    Michael> Does anyone know how to alphabetically sort the keys in a
    Michael> hash table?  Thanks,

Hi, Michael.

You can find the answer to this question in 'perldoc', under the FAQ
section.  The command to run would be 'perldoc -q 'sort a hash''.

The first section is reprinted below, hope this helps.

- Chris.

Found in /usr/share/perl/5.6.1/pod/perlfaq4.pod
       How do I sort a hash (optionally by value instead of key)?

       Internally, hashes are stored in a way that prevents you
       from imposing an order on key-value pairs.  Instead, you
       have to sort a list of the keys or values:

           @keys = sort keys %hash;    # sorted by key
-- 
$a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a
As to luck, there's the old miners' proverb: Gold is where you find it.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to