10.4. Create hash from an array

my @person = qw(fname Foo lname Bar);

my %user = @person;
my @foobar = %user;
print "@foobar\n"; # fname Foo lname Bar

$user{phone} = '123-456';


%user = (phone => '123-456'); # removes all previous elements from the hash

If you are interested in on-site trainings by the author, please contact me directly.

Online courses:

Would you like to get
updated when I publish
the next article?

Follow me:

Google Plus Twitter RSS feed