DavidSzczesniak
12/12/2017 - 10:32 AM

Hash Indexing

Brief notes on accessing individual hash values.

# The basic keyed access syntax:
my $address = $addresses{$name};

# String literals can also be used as hash keys:
my $address = $addresses{Victor}; # bareword, auto-quoted by perl

my $address = $addresses{'Sue-Lin'}; # not a bareword, needs quoting

my $address = $addresses{get_name()}; # function call needs disambiguation