peiyuan1030 发表于 2018-8-30 10:22:35

perl中按hash值排序

foreach my $key ( sort { $hash{$a} cmp $hash{$b} } keys %hash ) {  
    my $value = $hash{$key};
  
    # do something with ($key, $value)
  
}


页: [1]
查看完整版本: perl中按hash值排序