二维哈希

“`perl

$hash{“chr01”}{“NAT”}=300;

$hash{“chr02”}{“lincRNA”}=278;

$hash{“chr03”}{“intronic”}=12;

$hash{“chr01”}{“NAT”}=13;

$hash{“chr02”}{“NAT”}=14;

foreach my $key1 (keys %hash)

{

# 按染色体进行打印

my $hash2 = $hash{$key1}; #

foreach my $key2 ( keys %$hash2)

{

print $key1.”\t”.$key2.”\t”.$hash2->{$key2}.”\n”;

}

# 按染色体进行打印

}

“`

    原文作者:TZhao
    原文地址: https://www.jianshu.com/p/3c67a23563e1
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞