Perl 中的 Data::Dump 和 Data::Dumper 模块有什么区别?
What is difference between Data::Dump and Data::Dumper modules in Perl?
我已经使用 Data::Dumper
很长时间了。在 google 上搜索时,我发现了一个类似的模块 Data::Dump
。
谁能告诉我,他们提供的子程序之间的主要区别是什么?
来自 Data::Dump 文档:
The Data::Dump module grew out of frustration with Sarathy's in-most-cases-excellent Data::Dumper. Basic ideas and some code are shared with Sarathy's module.
The Data::Dump module provides a much simpler interface than Data::Dumper. No OO interface is available and there are fewer configuration options to worry about. The other benefit is that the dump produced does not try to set any variables. It only returns what is needed to produce a copy of the arguments. This means that dump("foo") simply returns '"foo"', and dump(1..3) simply returns '(1, 2, 3)'.
我已经使用 Data::Dumper
很长时间了。在 google 上搜索时,我发现了一个类似的模块 Data::Dump
。
谁能告诉我,他们提供的子程序之间的主要区别是什么?
来自 Data::Dump 文档:
The Data::Dump module grew out of frustration with Sarathy's in-most-cases-excellent Data::Dumper. Basic ideas and some code are shared with Sarathy's module.
The Data::Dump module provides a much simpler interface than Data::Dumper. No OO interface is available and there are fewer configuration options to worry about. The other benefit is that the dump produced does not try to set any variables. It only returns what is needed to produce a copy of the arguments. This means that dump("foo") simply returns '"foo"', and dump(1..3) simply returns '(1, 2, 3)'.