【发布时间】:2010-12-20 01:40:43
【问题描述】:
# I have a hash
my %my_hash;
# I have an array
@my_array = ["aa" , "bbb"];
# I store the array in my hash
$my_hash{"Kunjan"} = @my_array;
# But I can't print my array's element
print $my_hash{"Kunjan"}[0];
我是 Perl 的新手。请帮帮我。
【问题讨论】:
-
还没有人提到它,但请查看 Data Structures Cookbook。它有许多用于在各种嵌套结构中创建和访问数据的示例。您可以使用命令
perldoc perldsc在您的机器上阅读它,也可以在perldoc.perl.org/perldsc.html 找到它
标签: perl hash perl-data-structures