#!/usr/bin/perl # Read the states status data and write an HTML table # status of the states #name;organizing;ucan reg;ballot;GPUSA;ASGP # GPUSA variables: ng, gpusa, pending ; (locals or the whole) # ASGP variables: na, asgp, pending #Alabama;no;no;no;ng;no;na; #Alaska;yes;yes;yes;ng;;na; #Arizona;yes;yes;unknown;ng;asgp; #Arkansas;yes;no;no;ng;asgp; #California;yes;yes;yes;ng;asgp; #Colorado;yes;yes;yes;ng;asgp; $lines=0; $junkc=0; while () { if ( m/^#/ ) { $lines++; }else{ $lines++; ($state, $orging, $canreg, $ballotq, $gpusa, $asgp, $url, $junk) = split(";",$_); if ( not $junk eq "\n") { print STDERR ("junk at line $lines : $junk \n"); $junkc++; } else { $orging{$state} = $orging; $canreg{$state} = $canreg; $ballotq{$state} = $ballotq; $gpusa{$state} = $gpusa; $asgp{$state} = $asgp; $url{$state} = $url; } } } $junkc && die "too much junk\n"; print ("\n\n"); $orgings=0; $orgings=0; $ballots=0; $gpusas=0; $asgps=0; foreach $st (sort(keys(%orging))) { print ( "\n", (($url{$st} eq "none")? "\n" : "" ), (($orging{$st} eq "yes") ? "" : "" ), (($canreg{$st} eq "yes") ? "" : "" ), (($ballotq{$st} eq "yes") ? "" : "" ), (($gpusa{$st} eq "gpusa")?"" : "" ), (($asgp{$st} eq "asgp")? "" : "" ), "\n" ); ($orging{$st} eq "yes") && $orgings++; ($canreg{$st} eq "yes") && $canregs++; ($ballotq{$st} eq "yes") && $ballots++; ($gpusa{$st} eq "gpusa") && $gpusas++; ($asgp{$st} eq "asgp") && $asgps++; } print ("\n \n", " \n"); print ("
$st$stactive can reg. on ballot GPUSA GP of the US 
totals $orgings $canregs$ballots $gpusas $asgps
\n");