programming-examples/perl/Hash/Using while and each function to output value in a hash.pl
2019-11-15 12:59:38 +01:00

7 lines
148 B
Perl

$hash{fruit} = orange;
$hash{sandwich} = club;
$hash{drink} = lemonade;
while(($key, $value) = each(%hash)) {
print "$key => $value\n";
}