如果我声明这样的哈希:
my %n = (a => {1 => "1a",2 => "2a"},"b" => {1 => "1b",2 => "2b"});
如何访问以下数据:n - > a - > 1?
我试过
print "$n{a{1}}";
print "$n{a ->{ 1}}";
这两个人没有工作
答案 0 :(得分:1)
请参阅perldsc
use warnings;
use strict;
my %n = (a => {1 => "1a",2 => "2a"},"b" => {1 => "1b",2 => "2b"});
print "$n{a}{1}\n";
__END__
1a