theravadamonk has asked for the wisdom of the Perl Monks concerning the following question:

I have a file it consists of email addresses. pls see below cat /tmp/PassedCLEAN_2.txt <>

I read it from start to end. when there are duplicates, I count one by one.

e.g <> in this case - has 2 mails. has 1 mail +and <> has 1 mail. I hope U got it. my below senders.cgi works. it gives the output as follows to my web page.
<> 1 2 1 4 2 1 1 1

How Can I print that data in side a table. I also need 2 tables headers Senders Messages Under Senders, ALL sender email addresses should be displayed. Under Messages their Counts should be displayed. or I need a Horizontal Bar char with email addresses and their Message Counts. some thing better is needed.

This is my sender.cgi code

#!/usr/bin/perl #senders.cgi use CGI ':standard'; use strict; use warnings; print header(); print start_html(-title =>'Senders', -bgcolor=>'#95B8DB'); print "<br />"; print "<h1><center>Senders \n\n\n</center></h1>"; print "<br />"; system("sudo grep -E 'Passed CLEAN.* ->.*' /var/log/maillog | grep -v +root@ > /tmp/PassedCLEAN.txt"); system("sudo awk '{print \$12}' /tmp/PassedCLEAN.txt > /tmp/PassedCLEA +N_1.txt"); system('sed -e "s/<\(.*\@.*\)>/\1/g" /tmp/PassedCLEAN_1.txt > /tmp/Pas +sedCLEAN_2.txt'); my $logfile = '/tmp/PassedCLEAN_2.txt'; open my $fh, '<', $logfile or die "Could not open $logfile : $!"; my %count=(); while (my $line = <$fh>) { foreach my $word (split /\s+/, $line) { ++$count{$word}; #print "$word\n"; #print "<br />"; #print " \n"; } } print "<br />"; print "<br />"; for my $word (sort keys %count) { print "$word $count{$word}\n"; #print "$count{$word}\n"; print "<br />"; print " \n"; } close $fh; print "<br />"; print end_html;

How can I get it done? Hope to hear from you.