vinoth.ree has provided an easy and good solution.
But it might be even simpler to assign directly the list to the hash:
my %people = ("Andy", "1995", "Sarah", "1990", "Sam", "1992");
In reply to Re: How to change an Array to a Hash
by Laurent_R
in thread How to change an Array to a Hash
by alialialia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |