Write Perl Program Uses Hash Large Number Operations Hash Example Hash Could Store People Q37051812

Write a Perl program that uses a hash and a large number ofoperations on the hash. For example, the hash could store people’snames and their ages. A random- number generator could be used tocreate three- character names and ages, which could be added to thehash. When a duplicate name was generated, it would cause an accessto the hash but not add a new element. Rewrite the same programwithout using hashes. Compare the execution efficiency of the two.Compare the ease of programming and readability of the two.


Solution


Perl Code usinghash

my @chars = (“A”..”Z”, “a”..”z”); #list of characters used fornaming
my %data;   #declare

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.