+my $template;
+
+sub setprotocolparam {
+ {
+ no warnings 'uninitialized';
+ if( length $ENV{HTTPS} ) {
+ $template->param(PROTOCOL => "https");
+ }
+ else {
+ $template->param(PROTOCOL => "http");
+ }
+ }
+}
+
+sub printpage {
+ $template->param(COINLIFETIME => $COINLIFETIME);
+ $template->param(FLIPPEDCOINSINDB => $flippedcoinsindb);
+ $template->param(COINSINDB => $coinsindb);
+
+ my $rootloc = $ENV{SCRIPT_FILENAME};
+ $rootloc =~ s/$ENV{DOCUMENT_ROOT}//g;
+ $rootloc =~ s/\/[^\/]*$//g;
+ $template->param( ROOTURL => $ENV{HTTP_HOST} . $rootloc );
+
+ print "Content-type: text/html\n\n", $template->output;