programming-examples/perl/Hash/Keys function is used to get all keys in a hash.pl
2019-11-15 12:59:38 +01:00

14 lines
223 B
Perl

#!/usr/bin/perl -w
use strict;
my %where = (
G => "Dallas",
L => "Exeter",
I => "Reading",
S => "Oregon"
);
foreach (keys %where) {
print "$_ lives in $where{$_}\n";
}