Check out example codes for "perl add key value pair to hash". It will help you in understanding the concepts better.

Code Example 1

#!/usr/bin/perl

#-----------------------------------------
# perl-hash-add.pl
# created by alvin alexander, devdaily.com
#-----------------------------------------

# create a perl hash

$prices{'pizza'} = 12.00;
$prices{'coke'} = 1.25;
$prices{'sandwich'} = 3.00;

# traverse the perl hash and print
# the key/value pairs

print "\nforeach output:\n";
foreach $key (keys %prices)
{
  # do whatever you want with $key and $value here ...
  $value = $prices{$key};
  print "  $key costs $value\n";
}

Learn ReactJs, React Native from akashmittal.com