Answer Posted / raghav
Hash/Associative array is the one in which all
the values are stored in terms of keys and values.
i.e., the values are indexed with the help of keys.
You cannot get back the values in a correct order as it
happens in normal array. because in this values are stored
in random positions. The only way to get in a correct order
is to sort that array.
ex: %hash = {"Name","Raghav","Age","26"};
$hash{'Name'} will give "Raghav"
$hash{'Age'} will give "26"
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Why does Perl not have overloaded functions?
What is the importance of perl warnings? How do you turn them on?
What is the difference between perl array and perl hash?
What does the q{ } operator do?
What is perl I used for?
Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.
Which feature of perl provides code reusability?
What is “grep” function in perl?
What is q (single q) operator in perl?
You want to add two arrays together. How would you do that?
How do you set environment variables in perl?
What is the purpose of “_file_ literal” and “_line_ literal” in perl?
What is the purpose of goto expr statement?
What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?
How to add elements in a hash in perl?