Apache-FilteringProxy

 view release on metacpan or  search on metacpan

lib/Apache/FilteringProxy.pm  view on Meta::CPAN


		# get all current hosts in admin to make sure we dont add the
		# hostname a second time.  The admin tool clears old entries
		# out before starting, so we know all entries in the db are valid
		my $sth = $dbh->prepare("SELECT hostname from admin;");
		$sth->execute();

		# make list of hosts
		my @hostname_list;
		my $hostname;
		$sth->bind_columns(\$hostname);
		while ($sth->fetch()) {
			push(@hostname_list, $hostname);
		}
		if (!grep(/^$remote_servername$/,@hostname_list)) {
			my $sth = $dbh->prepare("INSERT INTO admin (id, hostname) VALUES (nextval('admin_id_seq'), '$remote_servername');");
			$sth->execute();
		}
		$sth->finish();
		$dbh->disconnect();
	}



( run in 0.544 second using v1.01-cache-2.11-cpan-2398b32b56e )