+ -
当前位置:首页 → 问答吧 → perl Data::Dumper中的$Data::Dumper::Purity 的作用是什么?

perl Data::Dumper中的$Data::Dumper::Purity 的作用是什么?

时间:2011-02-06

来源:互联网

RT

作者: zzy7186   发布时间: 2011-02-06



QUOTE:
The default output of self-referential structures can be evaled, but the nested references to $VARn will be undefined, since a recursive structure cannot be constructed using one Perl statement. You should set the Purity flag to 1 to get additional statements that will correctly fill in these references. Moreover, if evaled when strictures are in effect, you need to ensure that any variables it accesses are previously declared.



如果不是很理解还可以自己实验下嘛,其实根本原因是自引用的数据结构没法在一个语句内实现

作者: zhlong8   发布时间: 2011-02-06