print "PRESS 1 to display a single number details \n 2 to display all the numbers and details\n or any other key to EXIT :"; chomp($option2=); if ($option2 =="1") { print "Enter the number:"; my $input = ; chomp $input; if (exists $users{$input}) { print "@{ $users{$input} }\n"; print "$users{$input}[0] \n"; print "$users{$input}[1] \n"; } else { print "Unknown number.\n"; } } elsif ($option2 == "2") { # display all the numbers and their respective user and comments.something like the below one # The details for number 1234567 are user : sam, comments: changed abc in a file. The details for number 343434 are user:john, comments: deleted abc in a file } else { print "Invalid option\n"; }