use DBI; #do("./sql.pl"); print `netstat | grep "mysql" | wc -l`; $db="billing"; $user="user"; $passwd="me"; $host="localhost:3306"; $connectionInfo="dbi:mysql:$db;$host"; $select = "select id from sometable;"; $dbh=DBI->connect($connectionInfo,$user,$passwd) || print "DBI Connection Failed!($DBI::errstr)"; $sth=$dbh->prepare($select); if (!($sth->execute())) { } @row=$sth->fetchrow_array(); $sth->finish; $dbh->disconnect; print `netstat | grep "mysql" | wc -l`;