#!usr/bin/perl use DBI; use strict; my $one="one"; my $two="two"; my $three="three"; my $four="four"; # connect to the database, assigning the result to $dbh my $database="globalid"; my $host="autolabserver"; my $port="3306"; #connect to the database, assigning the result to $dbh my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host;port=$port", 'tester','auto55'); # die if we failed to connect die "Can't connect: " . DBI->errstr() unless $dbh; # all is well! print "Success: connected!\n"; my $sth = $dbh->prepare('INSERT INTO headerinfo (GLOBALID,DECIMAL,CONVERTED,COMMENT) VALUES(?,?,?,?)') or die "Can't prepare SQL: " . $dbh->errstr(); $sth->execute($one,$two,$three,$four) or die "Can't execute SQL: " . $sth->errstr(); # finish and disconnect $dbh->disconnect(); print "finished";