PERL 哈希排序 values

来源:互联网 发布:手机弹钢琴的软件 编辑:程序博客网 时间:2024/05/22 16:00
#!/usr/perl/bin
use strict;
use Data::Dumper;
my %h=(
"Alex"=>24,
"Sam"=>25,
"Bob"=>30,
"Andy"=>11,
"Wills"=>35,
"Mary"=>16,
"Helen"=>24
);

print(Dumper(\%h)); # output original hash

my @keys = sort { $h{$b} <=> $h{$a} } keys %h; #sort the hash table
for (@keys){print "$_ -> $h{$_}\n"}
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(508) | 评论(0) | 转发(0) |
0

上一篇:VIM 粘贴

下一篇:WIN7编译WIRESHARK

相关热门文章
  • python 自动化测试平台 Robot ...
  • python 自动化测试平台 Robot ...
  • python snmp 自动化2-在python...
  • 自动化测试详细测试计划 模板...
  • python snmp 自动化3-修改pyth...
  • linux dhcp peizhi roc
  • 关于Unix文件的软链接
  • 求教这个命令什么意思,我是新...
  • sed -e "/grep/d" 是什么意思...
  • 谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~
原创粉丝点击