10.4. Create hash from an arraymy @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
|
Follow me: