How can information be put into hashes?

Answer

When a hash value is referenced, it is not created. It is only created once a value is assigned to it. The contents of a hash have no literal representation. In case the hash is to be filled at once the unwinding of the hash must be done. The unwinding of hash means the key value pairs in hash can be created using a list, they can be converted from that as well. In this conversion process the even numbered items are placed on the right and are known as values. The items placed on the left are odd numbered and are stored as keys. The hash has no defined internal ordering and hence the user should not rely on any particular ordering.

Example of creating hash:

1
2
3
4
5
6
7
8
%birthdate=(Ram=>"01-01-1985",
 
 
Vinod=>"22-12-1983",
 
Sahil=>"13-03-1989",
 
Sony=>"11-09-1991");

All perl Questions

Ask your interview questions on perl

Write Your comment or Questions if you want the answers on perl from perl Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---