in reply to Hash sorting

Thanks for all the answers, I was hoping I can do without requiring another data structure like @data.

artist

Replies are listed 'Best First'.
Re: Re: Hash sorting
by Aragorn (Curate) on May 12, 2003 at 20:55 UTC
    How about something like this:
    my @items = qw(item in array); my @sections = qw(one two three); my @count = qw(6 3 4 2 1 5); sub numerically { $a <=> $b }; foreach my $c (sort numerically @count) { foreach my $s (sort numerically @sections) { foreach my $i (sort numerically @items) { print "$c $s $i\n"; } } }
    Arjen

    Updated:Items and Sections are not numerical.

    Updated:Argh! Nevermind. Tiredness and programming don't mix.