Looks like I am adding the same information in my hash when they should have different information. How do I just the the information I need?:
14014126,80321.1
14014126,80319.1
14014126,80172.1
13996815,81667.1
13996815,81630.1
13996815,81632.1
13996815,81678.1
13996815,81668.1
Here is my sub:
my $hash= shift;
foreach my $key(keys %hash){
my @response=`mold -obj $key`;
foreach my $rep(@response){
next if ($rep =~ /MCC/);
$rep =~s/preferred//;
$rep =~ s/^\s+$//;
$rep =~ s/^\s+//;
my($mcc,$spf_date,$spf_time,$spf,$dtt_date,$dtt_time,$dtt,$oms) = split (/\s+/,$rep);
$hash{$key}{$mcc}=$mcc++;
}
}
foreach my $test(keys %hash){
print "FIRST ROUND $test\n";
foreach my $mc(keys %{$hash{$test}}){
print "$mc\n";
}
}
Here is my output:
FIRST ROUND 14014126
80321.1
80319.1
80172.1
81667.1
81630.1
81632.1
81678.1
81668.1
FIRST ROUND 13996815
80321.1
80319.1
80172.1
81667.1
81630.1
81632.1
81678.1
81668.1
14014126,80321.1
14014126,80319.1
14014126,80172.1
13996815,81667.1
13996815,81630.1
13996815,81632.1
13996815,81678.1
13996815,81668.1
Here is my sub:
my $hash= shift;
foreach my $key(keys %hash){
my @response=`mold -obj $key`;
foreach my $rep(@response){
next if ($rep =~ /MCC/);
$rep =~s/preferred//;
$rep =~ s/^\s+$//;
$rep =~ s/^\s+//;
my($mcc,$spf_date,$spf_time,$spf,$dtt_date,$dtt_time,$dtt,$oms) = split (/\s+/,$rep);
$hash{$key}{$mcc}=$mcc++;
}
}
foreach my $test(keys %hash){
print "FIRST ROUND $test\n";
foreach my $mc(keys %{$hash{$test}}){
print "$mc\n";
}
}
Here is my output:
FIRST ROUND 14014126
80321.1
80319.1
80172.1
81667.1
81630.1
81632.1
81678.1
81668.1
FIRST ROUND 13996815
80321.1
80319.1
80172.1
81667.1
81630.1
81632.1
81678.1
81668.1