in reply to Re: Hash sorting
in thread Hash sorting
Thank you!!!! That worked!!! Why was the chomp placed before the split?my %calhash; my $key = ""; my $value = ""; while (<OUTFILE>) { chomp; my ($key, $value) = split(/;/, $_); $calhash{$key} = $value; } foreach $key (sort {$b cmp $a} keys %calhash) { print TESTFILE "$key;$calhash{$key}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Hash sorting
by rdfield (Priest) on Mar 15, 2002 at 16:32 UTC | |
|
Re: Re: Re: Hash sorting
by buckaduck (Chaplain) on Mar 15, 2002 at 16:53 UTC |