Gossamer Forum
Home : General : Perl Programming :

SHOW PROCESSLIST in Perl?

Quote Reply
SHOW PROCESSLIST in Perl?
Hi,
any idea why the following code-snippet doesn't work:

Code:
$dbh = $dbh->prepare("SHOW PROCESSLIST");
$dbh->execute;

my $table = $dbh->fetchall_arrayref;
my ($i, $j);
for $i (0 .. $#{$table}) {
for $j (0 .. $#{$table->[$i]}){
print "$table->[$i][$j]\t";
}
print "<br>";
}

Thanks for help!
Quote Reply
Re: [TB2] SHOW PROCESSLIST in Perl? In reply to
Code:
$dbh = $dbh->prepare("SHOW PROCESSLIST"); $dbh->execute; my $table = $dbh->fetchall_arrayref;

$sth = $dbh->prepare("SHOW PROCESSLIST");
$sth->execute;
my $table = $sth->fetchall_arrayref;