#! /usr/local/bin/perl
# $Id: makepref,v 1.1.1.1 1999/03/02 02:28:05 t-ishii Exp $

open(PREF,"psql -q -t -F '\t' -c \"select pid,pref from prefecture order by pid\" $ARGV[0]|")||die "Couldn't execute psql";
print "<?\n";
while(<PREF>) {
	chop;
	m/^[^\t]*\t([^\t]*)/;
	print "\$pref_tbl\[\] = \"$1\";\n";
}
close(PREF);
print "?>\n";
