in reply to MySQL Query Time DBI

Assuming you want to do this strictly in perl, you could do something like this:
while(<FH>) { my $line = $_; chomp($line); $line =~ /^[\d]+ rows in set \(([^\)]+)/; $retValue = $1 if (defined($1)); } close FH; print "The value is '$retValue'\n";
My full test program is here:
#!/usr/bin/perl -w # my $text=<<EOL; mysql> select * from shop; +---------+--------+-------+ | article | dealer | price | +---------+--------+-------+ | 0001 | A | 3.45 | | 0001 | B | 3.99 | | 0002 | A | 10.99 | | 0003 | B | 1.45 | | 0003 | C | 1.69 | | 0003 | D | 1.25 | | 0004 | D | 19.95 | +---------+--------+-------+ 7 rows in set (0.00 sec) EOL if ( ! open(FH,"echo '$text' |" ) ) { die "can't open\n"; } my $retValue = ''; while(<FH>) { my $line = $_; chomp($line); $line =~ /^[\d]+ rows in set \(([^\)]+)/; $retValue = $1 if (defined($1)); } close FH; print "The value is '$retValue'\n";
To explain, the pattern match /^[\d]+ rows in set \(([^\)]+)/ captures everthing between the parens into $1.