ashaman has asked for the wisdom of the Perl Monks concerning the following question:
and then for the printing:sort %filelist; sort %playlist;
now here's the two problems with those snipets. in the first one, it just doesn't sort. or, if it does, hardly the way i want. i need it alphabetically ordered, and when i look at the output, it . . . well . . . isn't. and then for the second part, what happens is that it'll print out filelist, but not playlist. if i say for (keys %playlist) instead, however, it prints playlist and not filelist. so essentially i need the two hashes sorted and some way of going through the keys for both hashes and printing them out. this is confusing because the sorting would work if they were arrays, would it not? and i just plain have no clue how to go about the second part. thanks in advancefor (keys %filelist) { print TEST $playlist{$_} . "\n"; print TEST2 $filelist{$_} . "\n"; }
Edit kudra, 2001-10-17 Changed title per ntc suggestion
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: two questions that come together into one grand unified question
by premchai21 (Curate) on Oct 15, 2001 at 07:58 UTC | |
Re: two questions that come together into one grand unified question
by jryan (Vicar) on Oct 15, 2001 at 08:16 UTC | |
by Hofmator (Curate) on Oct 15, 2001 at 16:14 UTC | |
Re: two questions that come together into one grand unified question
by jbert (Priest) on Oct 15, 2001 at 17:19 UTC | |
Re: two questions that come together into one grand unified question
by IraTarball (Monk) on Oct 15, 2001 at 23:28 UTC | |
Sorting a hash
by Anonymous Monk on Oct 16, 2001 at 11:48 UTC |