perl数据结构输出 Data::Dumper

前端之家收集整理的这篇文章主要介绍了perl数据结构输出 Data::Dumper前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
</pre><pre name="code" class="sql">oaapp01:/root/test# cat a1.pl 
use Data::Dumper;
%hash=(a=>1,b=>2,c=>3);  
$refhash=\%hash;  
print %$refhash;  
print "\n"; 
print "dump 数据结构\n";
print Dumper(%hash);
oaapp01:/root/test# perl a1.pl 
c3a1b2
dump 数据结构
$VAR1 = 'c';
$VAR2 = 3;
$VAR3 = 'a';
$VAR4 = 1;
$VAR5 = 'b';
$VAR6 = 2;

猜你在找的Perl相关文章