Perl: Creating A Hash
Creating A Hash
Normally, a hash is created by adding elements directly to the hash:
$jobs{"homer"} = "Nuclear Technician";
$jobs{"bart"} = "Troublemaker";
# now the %jobs hash contains two elements
You can create a hash using
key => value pairs though:
homer => "Nuclear Technician",