my $end_date; ## calculate what days there were lotto # my @prev_day = Add_Delta_Days(@today,0); ## # they started midday drawnings... $end_date = "2/5/2001\n"; for (;;) { @prev_day = Add_Delta_Days(@prev_day,-1); my ($sat_year,$sat_month,$sat_day) = Add_Delta_Days(@prev_day,0); my $sat_date = "$sat_month\/$sat_day\/$sat_year\n"; if ($sat_date eq $end_date) { push(@lotto_dates,"$sat_month\/$sat_day\/$sat_year\:M\n"); push(@lotto_dates,"$sat_month\/$sat_day\/$sat_year\:E\n"); last; } else { push(@lotto_dates,"$sat_month\/$sat_day\/$sat_year\:M\n"); push(@lotto_dates,"$sat_month\/$sat_day\/$sat_year\:E\n"); } } ## # theres no midday drawnings past this day... $end_date = "4/6/1997\n"; for (;;) { @prev_day = Add_Delta_Days(@prev_day,-1); my ($sat_year,$sat_month,$sat_day) = Add_Delta_Days(@prev_day,0); my $sat_date = "$sat_month\/$sat_day\/$sat_year\n"; if ($sat_date eq $end_date) { push(@lotto_dates,"$sat_month\/$sat_day\/$sat_year\:E\n"); last; } else { push(@lotto_dates,"$sat_month\/$sat_day\/$sat_year\:E\n"); } } ## # there are 131 dates on one page my @html; my $count = 131; foreach my $line (@lotto_dates) { if ($count == 131) { my $url = "http://www.georgialottery.com/lottery/win.cgi?game=7&ten=yes&enddate=$line"; my $url_data = get $url; push(@html,$url_data); $count = 0; } $count++; } ## i shouldn't do this, should i? # open(HTML,">html.txt"); print HTML @html; close(HTML); ## extract table info from array # my $extract = new HTML::TableExtract( headers => ['Date','Numbers'] ); my $ts; my $row; undef $/; ## help? # open(HTML, "html.txt"); my $lotto = ; close(HTML); open(NUMBERS, ">c4_numbers.txt"); $extract->parse($lotto); foreach $ts ($extract->table_states) { foreach $row ($ts->rows) { print NUMBERS join(":", @$row), "\n"; } } close(HTML); close(NUMBERS);