in reply to Includes, strict and pointers.

Its a bit more abstraction than you're asking for, but I've found DBIx::DWIW to be a perfect fit for this situation.

After the initial configuration (i.e. putting your user/pass in a customized VoteDBI.pm package), you can replace all the username/password/connect code above with a single line, such as:

my $db = VoteDBI->Connect('vote_table') or die;
Besides, its what Yahoo! Finance is using, so its got to be good, right?

p.s. As shipped, the module is MySQL specific, but I have a hacked version that works with postgresql. A couple lines changes and you can probably get it working with your favorite database, too.

-Blake