#!f:/perl/bin/perl.exe -w use strict; my $PowerballHistoricFile='d:/code/perl/lottery/powerball_numbers.txt' +; my(%History,$Date,@Numbers); open(HISTORY,$PowerballHistoricFile) or die "Could not open $Powerball +HistoricFile!"; foreach my $Line(<HISTORY>){ ($Date,@Numbers)=split(/ /,$Line); $History{$Date}=[@Numbers]; } close(HISTORY); my(%Frequency,%Frequency2); foreach my $Key(sort(keys(%History))){ for my $SubCounter(0..4){ $Frequency{$History{$Key}[$SubCounter]}++; } } foreach my $Key(sort(keys(%Frequency))){ if($Frequency2{$Frequency{$Key}}){ $Frequency2{$Frequency{$Key}}.=", $Key"; } else { $Frequency2{$Frequency{$Key}}=$Key; } } print "Content-Type: text/html\n\n<html><body>\n"; print qq(<br><table border="1" cellpadding="2" cellspacing="0" align=" +center"><caption style="font-size: 15px; font-weight: bold;">Power Ba +ll Historic Information</caption>\n); print qq(<tr bgcolor="#dddddd"><th>Number of Drawings</th><th>Numbers< +/th></tr>\n); foreach my $Key(sort(keys(%Frequency2))){ print qq(<tr><td align="center">$Key</td><td>$Frequency2{$Key}</td +></tr>\n); } print qq(</table>\n</body></html>\n); exit;
In reply to Re: Powerball mania!
by ckohl1
in thread Powerball mania!
by patgas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |