#!/usr/bin/perl # example polling program # use the below in place of use WWW::Poll to test local #use lib qw( ../ ); #use Poll; use strict; use lib '/home/oc/cgi-bin/poll/'; use Poll; $ENV{'QUERY_STRING'}=$ENV{'REQUEST_URI'}; $ENV{'QUERY_STRING'}=~s/^.*\?(.*)$/$1/; use CGI qw/:standard/; my $POLLPATH='/home/oc/cgi-bin/poll/data'; my $deBug = 0; my %cookie=(); my %form=(); my $poll=new WWW::Poll; $poll->path($POLLPATH); &main(); sub main { $poll=new WWW::Poll; $poll->path($POLLPATH); $ENV{'SCRIPT_NAME'}=$ENV{'DOCUMENT_URI'}; my $query = new CGI; foreach ($query->param) { $form{$_}=$query->param($_); } foreach ($query->cookie) { $cookie{$_}=$query->cookie($_); } my $action = $query->param(-name=>'action'); &list_polls; } sub list_polls { my %polls = $poll->list; my $html = "
".$poll->get_html($_)." | "; $counter++; my $z = $counter / $mod; $rem = $z - int $z; $html.="No polls in archive jet. | "; } $html.="" if ($rem ne '0'); $html .= "