Index: branches/htmlform/cgi-bin/main.cgi
===================================================================
--- branches/htmlform/cgi-bin/main.cgi	(revision 492)
+++ branches/htmlform/cgi-bin/main.cgi	(revision 493)
@@ -150,5 +150,5 @@
 elsif ($webvar{action} eq 'nodesearch') {
   $sth = $ip_dbh->prepare("SELECT node_id, node_name FROM nodes ORDER BY node_type,node_id");
-  $sth->execute() or print "DEBUG: failed retrieval from nodes: ".$sth->errstr,"<br>\n";
+  $sth->execute() or $page->param(errmsg => $sth->errstr);
   my @nodelist;
   while (my ($nid,$nname) = $sth->fetchrow_array()) {
@@ -183,8 +183,4 @@
 finish($ip_dbh);
 
-#print qq(<div align=right style="position: absolute; right: 30px;">).
-#	qq(<a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div><br>\n)
-#	if $IPDBacl{$authuser} =~ /A/;
-
 ## Do all our printing here so we can generate errors and stick them into the slots in the templates.
 
@@ -202,40 +198,4 @@
 # properly... we exit explicitly.
 exit 0;
-
-
-# args are: a reference to an array with the row to be printed and the 
-# class(stylesheet) to use for formatting.
-# if ommitting the class - call the sub as &printRow(\@array)
-sub printRow {
-  my ($rowRef,$class) = @_;
-
-  if (!$class) {
-    print "<tr>\n";
-  } else {
-    print "<tr class=\"$class\">\n";
-  }
-
-ELEMENT:  foreach my $element (@$rowRef) {
-    if (!defined($element)) {
-      print "<td></td>\n";
-      next ELEMENT;
-    }
-    $element =~ s|\n|</br>|g;
-    print "<td>$element</td>\n";
-  }
-  print "</tr>";
-} # printRow
-
-
-# Prints table headings.  Accepts any number of arguments;
-# each argument is a table heading.
-sub startTable {
-  print qq(<center><table width="98%" cellspacing="0" class="center"><tr>);
-
-  foreach(@_) {
-    print qq(<td class="heading">$_</td>);
-  }
-  print "</tr>\n";
-} # startTable
 
 
@@ -498,6 +458,4 @@
   $page->param(city => $poolcity);
 
-#  print qq(<center><div class="heading">Listing pool IPs for $cidr<br>\n).
-#	qq(($disp_alloctypes{$pooltype} in $poolcity)</div></center><br>\n);
   # Only display net/gw/bcast if it's a "real" netblock and not a PPP(oE) lunacy
   $page->param(realblock => $pooltype =~ /^.d$/);
@@ -565,5 +523,4 @@
 	"and type not like '_i' and type not like '_r' order by listorder");
       $sth->execute;
-      my @data = $sth->fetchrow_array;
       my @typelist;
       my $selflag = 0;
