programming-examples/perl/Hash/Using each to get key and value pair from hash.pl

7 lines
123 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
$hash2{A} = F;
$hash2{B} = E;
$hash2{'C'} = D;
while(($key, $value) = each(%hash)) {
print "$key => $value\n";
}