Data::Dumper
print $LOG Dumper( \%some_complex_hash );
或使用File::Slurp:
write_file 'mydump.log',Dumper( \%some_complex_hash );
进一步的想法:你可能想养成使用的习惯:
warn Dumper( \%some_complex_hash );
并在调用脚本时将标准错误重定向到文件(如何执行此操作取决于shell).例如:
C:\Temp> sdf.pl 2>dump