#!/usr/bin/perl -w

use DBI;
$dbh = DBI->connect("DBI:mysql:nations","randy") || die "Could not connect to the db";

$dbh->do("drop table users;"); # error OK
$dbh->do("create table users(name char(20), uid decimal(8,0));") || die "Could not create table";


open(FILE, "</etc/passwd") || die "I was bad";

while ($line = <FILE>)
{
	($user, $passwd, $uid, $junk) = split(":", $line);
	if ($user eq "jurbania") 
	{
		next;
	}
	$dbh->do("INSERT into users values (\"$user\", '$uid');") || die "Icky";
	print "USER = $user UID = $uid\n";
	
}
