ByteOrNybble has asked for the wisdom of the Perl Monks concerning the following question:
use strict; my $names = " John 20, Bill 34, Jane 28, Wall 18, Tom 19"; print $names,"\n"; my %hash_list = sort(split (/,/, $names)); print %hash_list,"\n"; my @keys = sort { $hash_list{$a} cmp $hash_list{$b} } keys %hash_list; print %hash_list, "\n"; print @keys, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Keys/Values being lost with this code--any help?
by lestrrat (Deacon) on Sep 24, 2002 at 03:52 UTC | |
|
Re: Keys/Values being lost with this code--any help?
by Zaxo (Archbishop) on Sep 24, 2002 at 04:05 UTC | |
|
Re: Keys/Values being lost with this code--any help?
by tadman (Prior) on Sep 24, 2002 at 05:09 UTC | |
|
Re: Keys/Values being lost with this code--any help?
by dws (Chancellor) on Sep 24, 2002 at 04:15 UTC | |
|
Re: Keys/Values being lost with this code--any help?
by dbp (Pilgrim) on Sep 24, 2002 at 06:21 UTC | |
by ByteOrNybble (Novice) on Sep 24, 2002 at 15:28 UTC | |
by lestrrat (Deacon) on Sep 24, 2002 at 20:59 UTC |