如何查看或打印复杂变量到文件?

时间:2017-08-01 07:59:30

标签: perl file-handling

我有一个非常庞大的对象,我希望看到该对象的数据结构或内容。

我无法在cmd行或文件上打印。记忆犹新!错误。

use strict;
use warnings;
use Data::Dumper;

my $self = { #this is a big object with complex data structure };

#first tried printing normally on cmd line. It didn't help
#print Dumper $self;


open(my $fh, '>', 'report.txt');
print ($fh Dumper($self));
close $fh;

关于如何实现这一目标的任何想法或建议?

0 个答案:

没有答案