programming-examples/perl/Hash/Associative arrays are indexed by string values.pl
2019-11-15 12:59:38 +01:00

8 lines
190 B
Perl

#!/usr/local/bin/perl -w
my %cities = ("Toronto" => "East", "Calgary" => "Central", "Vancouver" => 'West');
for $key (keys %cities)
{
print "Key: $key Value: $cities{$key} \n";
}