Qualcomm Interview Question
Software Engineer in Tests#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
my @arrays ;
my $user = "Balaksihan" ;
open(IN ,"< C:/Users/Balakishan_Belde/Desktop/perl/userdetails.txt") ;
my %hash ;
while (<IN>)
{
chomp;
my ($key, $val) = split /:/;
$hash{$key} .= exists $hash{$key} ? ",$val" : $val;
}
print $hash{$user} ;
Can we use HashMap?
- sp!de? March 17, 2012address can be key and other information can be value