programming-examples/perl/Hash/An associative array, called a hash, is an unordered list of key-value pairs, indexed by strings.pl

10 lines
224 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#The name of the hash is preceded by a "%" symbol.
%employee = (
"Name" => "AA",
"Phone" => "(999) 555-1234",
"Position" => "CEO"
);
print $employee{"Name"};
$employee{"SSN"}="999-333-2345";