What is a hash?

Answer Posted / savitha sridhar

Hash or "Associative Array" is an unordered list of scalar
data. The data of the hash is depicted as key and a value
pair.

Eg: %h=("kar","blr","ap","hyd","tn","che");

To print the entire hash : print %h; --returns entire hash
(the order may be different)
To print only one value : print $h{"kar"}; -->returns blr

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use "use strict" in perl?

533


What is perl dbi?

493


What are hashes?

540


What is a chomp() function in perl?

519


Explain the internal working of cgi

509






How does polymorphism work in perl?

518


Explain lists and ivalue?

561


What is perl push array function?

543


Explain perl. When do you use perl for programming? What are the advantages of programming in perl?

467


Mention what is cpan?

579


What is it meants by '$_'?

541


Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)

620


Explain strftime() function in perl?

541


How to code in perl to implement the tail function in unix?

531


What does length(%HASH) produce if you have thirty-seven random keys in a newly created hash?

576