programming-examples/perl/Hash/Iterate hash.pl
2019-11-15 12:59:38 +01:00

12 lines
214 B
Perl

#!/usr/bin/perl
use strict;
use warnings;
my %hash = ('Key1' => 'Value1', 'Key2' => 'Value2');
print "$_ => $hash{$_} \n" foreach keys %hash;
foreach (sort values %hash) {
print "Value: $_ \n";
}