programming-examples/perl/Statement/Using foreach statement with hash.pl

7 lines
138 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
$hash{fruit} = orange;
$hash{sandwich} = club;
$hash{drink} = lemonade;
foreach $key (keys %hash) {
print $hash{$key} . "\n";
}