#!/usr/bin/perl use DBI; $database = "qsrsubs"; require '/home/sites/jdb.cgi'; print "DBH = $dbh\n"; print "DSN = $dsn\n"; $cmd = "show variables"; $sth = $dbh->prepare($cmd); $sth->execute(); while (@ary = $sth->fetchrow_array) { print "PORT = $ary[1]\n" if grep(/port/, @ary); }