What is a hash?

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


Please Help Members By Posting Answers For Below Questions

Define dynamic scoping.

570


What are the various perl data types based on the context?

617


Explain use of ‘my’ keyword in perl?

644


what are steps to do to lock the sony ericsson mobile with password?

1884


Explain arrays in perl.

599






Explain '->' in perl?

587


Why Perl aliases are considered to be faster than references?

621


In CPAN module, name an instance you use.

617


What is the use of -w, -t and strict in Perl?

649


How do I read command-line arguments with Perl?

683


What does the q{ } operator do?

590


Write a program to decode the data in the form using cgi programming

614


How do you turn on the perl warnings?

567


what are prefix dereferencer and list them out?

706


How to merge two arrays in perl?

613