The script below outputs the correct $number (hash key) but for some reason
it also outputs the value. What gives?

-Pete

###############################

use strict;

my %countother;


print "File: ";
chomp(my $file=<STDIN>);

open(FILE,$file) || die "can't open file : $!\n";

foreach (<FILE>)
{
        chomp($_);
        my @line = split(/\,/,$_);
        my ($number) = $line[8] =~ /\"(.*)\"/;
        $countother{$number}++;
}
close(FILE);


my $count = keys %countother;

print "Total of $count numbers used in ~ 1 week.\n";
print "*****************************************************\n";
print "NUMBER           CALLS\n";

foreach my $number (%countother)
{
        print "$number\n";
}

Reply via email to