programming-examples/perl/Statement/Use foreach to loop through hash with keys function.pl

7 lines
111 B
Perl
Raw Normal View History

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