{ my %MSISDN=(); #populate the subscription list to hash MSISDN open(FILE,"/tmp/subscription_list") || die "Unable to open subscription file"; sub file_merge(\%MSISDN); close(FILE); my %Calls=(); #populate the usage types to hash Calls open(FILE1,"/tmp/Call_Det")|| die "Unable to open call_details file"; sub file_merge(\%Calls); close(FILE1); } sub file_merge(%hash_ref) { while (<>) { chomp; my ($key, @values) = split /-/, $_; push @{$hash_ref{$key}}, [ @values ]; } }