in reply to Re: Working with arrays
in thread Working with arrays

yes, instead of having it come out in the order typea, typex, typey, and typez, i want it to come out in the order of typex,typey,typea,typez

Replies are listed 'Best First'.
Re (3): Working with arrays
by VSarkiss (Monsignor) on Jul 24, 2002 at 15:41 UTC

    Alright. The ordering you're getting now is alphabetical, as a result of sort keys %data.

    I can't see an ordering in the series "x", "y", "a", "z". The only way I can see to do that is to define it explicitly, something like this: foreach my $key (qw(typex typey typea typez))

    If there is an order to that series that I'm not seeing, you may be able to capture the logic in a custom sort function. Look up the sort docs for more info.

    HTH

      ok..thanks for the help