Solution 1 :
while ( ($key,$value) = each %hash ) {
print "$k => $v\n";
}
Solution 2 :
print map { "$_ => $hash{$_}\n" } keys %hash;
Solution 3 :
print "@{[ %hash ]}\n";
Solution 4 :
{
my @temp = %hash;
print "@temp";
}
Solution 5 :
foreach $key (sort keys %hash) {
print "$key => $hash{$key}\n";
}
Tuesday, March 10, 2009
Printing a Hash
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment