二维哈希

2017-06-02  本文已影响0人  TZhao

```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";

}

# 按染色体进行打印

}

```

上一篇下一篇

猜你喜欢

热点阅读