jamen has asked for the wisdom of the Perl Monks concerning the following question:
I have more code above and below but it works fine so I'm notmy %calhash; my $key = ""; my $value = ""; while (<OUTFILE>) { my ($key, $value) = split(/;/, $_); chomp; $calhash{$key} = $key; } foreach $key (sort {$b cmp $a} keys %calhash) { print TESTFILE "$calhash{$key};$value\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash sorting
by dmmiller2k (Chaplain) on Mar 13, 2002 at 18:39 UTC | |
|
Re: Hash sorting
by buckaduck (Chaplain) on Mar 13, 2002 at 18:20 UTC | |
by derby (Abbot) on Mar 13, 2002 at 18:23 UTC | |
by jamen (Initiate) on Mar 15, 2002 at 16:25 UTC | |
by rdfield (Priest) on Mar 15, 2002 at 16:32 UTC | |
by buckaduck (Chaplain) on Mar 15, 2002 at 16:53 UTC | |
|
Re: Hash sorting
by broquaint (Abbot) on Mar 13, 2002 at 18:19 UTC | |
|
Re: Hash sorting
by tomhukins (Curate) on Mar 13, 2002 at 18:31 UTC | |
|
Re: Hash sorting
by dragonchild (Archbishop) on Mar 13, 2002 at 18:24 UTC | |
|
Re: Hash sorting
by PrimeLord (Pilgrim) on Mar 13, 2002 at 18:21 UTC |