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

What is boolean context?

550


Why should I use the -w argument with my Perl programs?

560


What is perl shift array function?

526


Explain what is lvalue?

603


How will you open a file in a write-only mode in perl?

480






What does the q{ } operator do?

517


Is there any way to add two arrays together?

574


You want to empty an array. How would you do that?

478


When do you use perl programming?

587


What is a chop() function in perl?

574


What are prefix dereferencer? List them.

568


what are the two ways to get private values inside a subroutine or block?

508


How to check the status of airplane mode (enable/disable) in perl for Android mobile?

2608


How to open and read data files with Perl

610


explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.

460