You should be using a hash for your group list. I think it was Larry who said it first, but the phrase "arrays are for ordering, hashes are for searching" comes to mind. If you find yourself searching an array, or wishing the hash were ordered,
you probably did the wrong thing. There
are exceptions, but rare.
-- Randal L. Schwartz, Perl hacker