Perl中嵌套数据结构的简单参考或备忘单是什么?

时间:2009-08-05 21:23:49

标签: perl data-structures reference

Perl中嵌套数据结构的简单参考或备忘单是什么?

6 个答案:

答案 0 :(得分:8)

一个优秀的开始教程是perldoc perlreftut。我还强烈推荐内置Perl文档中的另外两个教程:perldoc perllolperldoc perldsc。 (我按照这个顺序完成了它们,但你的里程可能会有所不同。我也发现在之后我更容易阅读perldoc perlref 我完成了这些教程,但同样,你可能没有。)< / p>

如果您安装了正常的Perl,您应该始终能够通过终端获取这些内容。但您也可以通过网络(以及可下载的pdf)通过这些链接获取它们。

对于备忘单/参考表,你可能会比PerlMonks上的this post更糟糕。

答案 1 :(得分:4)

perldoc perldsc有助于理解这些嵌套结构

PERLDSC(1)            User Contributed Perl Documentation           PERLDSC(1)

NAME
       perldsc - Perl Data Structures Cookbook

DESCRIPTION
       The single feature most sorely lacking in the Perl programming language
       prior to its 5.0 release was complex data structures.  Even without
       direct language support, some valiant programmers did manage to emulate
       them, but it was hard work and not for the faint of heart.  You could
       occasionally get away with the $m{$AoA,$b} notation borrowed from awk
       in which the keys are actually more like a single concatenated string
       "$AoA$b", but traversal and sorting were difficult.  More desperate
       programmers even hacked Perlâs internal symbol table directly, a strat-
       egy that proved hard to develop and maintain--to put it mildly.

答案 2 :(得分:2)

尝试perldoc perlcheat

REFERENCES
 \ references $$foo[1] aka $foo->[1]
 $@%&* dereference $$foo{bar} aka $foo->{bar}
 [] anon. arrayref ${$$foo[1]}[2] aka $foo->[1]->[2]
 {} anon. hashref ${$$foo[1]}[2] aka $foo->[1][2]
 \() list of refs

答案 3 :(得分:0)

也许最明确的参考是perlref

我同意使用简单的参考或备忘单会很好。

perldsc(Perl数据结构食谱)末尾的示例可作为合理的快速参考。

答案 4 :(得分:0)

perldsc食谱清单。

答案 5 :(得分:0)