to visualize a complex data structure rapidly is to
dump it.
- use Data::Dumper;
-
-
my %total_bytes;
-
while (<>) {
-
my ($source, $destination, $bytes) = split;
-
$total_bytes{$source}{$destination} += $bytes;
-
}
-
-
print Dumper(\%total_bytes);
- myhost% perl bytecounts2 <bytecounts-in
-
$VAR1 = {
-
'thurston.howell.hut' => {
-
'lovey.howell.hut' => 1250
-
},
-
'ginger.girl.hut' => {
-
'maryann.girl.hut' => 199,
-
'professor.hut' => 1218
-
},
-
'professor.hut' => {
-
'gilligan.crew.hut' => 1250,
-
'lovey.howell.hut' => 1360
-
}
-
};
阅读(727) | 评论(0) | 转发(0) |