my @word = keys %count;
my @count_word = map{ $count{$_} || 0 } @word;
####
my @word = ( (sort { $count{$b} <=> $count{$a} } keys %count) [0..4] );
my @count_word = map{ $count{$_} || 0 } @word;
####
#for my $word ( (sort { $count{$b} <=> $count{$a} } keys %count) [0..4] ) {
# #print "$word $count{$word}\n";
#}
####
my $data = GD::Graph::Data->new([
[@word],
[@count_word],
]) or die GD::Graph::Data->error;
####
my $data = GD::Graph::Data->new([
[@word],
[@count_word],
[@count_word_recip],
]) or die GD::Graph::Data->error;
####
my $logfile_recip = '/tmp/recipients.txt';
open my $fh, '<', $logfile_recip or die "Could not open $logfile_recip : $!";
my %count_recip=();
while (my $line = <$fh>) {
foreach my $word (split /\s+/, $line) {
++$count_recip{$word};
#print "$word\n";
#print "$count_recip{$word}\n";
#print "
";
#print " \n";
}
}
#for my $word ( (sort { $count_recip{$b} <=> $count_recip{$a} } keys %count_recip) [0..4] ) {
# #print "$word $count_recip{$word}\n";
#}
close $fh;
my @word_recip = ( (sort { $count_recip{$b} <=> $count_recip{$a} } keys %count_recip) [0..4] );
my @count_word_recip = map{ $count_recip{$_} || 0 } @word_recip;
#my $data = GD::Graph::Data->new([
# [@word_recip],
# [@count_word_recip],
#]) or die GD::Graph::Data->error;
####
my $data = GD::Graph::Data->new([
[@word @word_recip],
[@count_word],
[@count_word_recip],
]) or die GD::Graph::Data->error;