or download this
$output = $cli->cmd("/usr/mysql/bin/mysql -E -uuser -ppass -D targetdb
+ -e \"select * from table;\" | tail -2");
$temp = $output;
...
print "\ntemp\n----------------\n$temp\n";
my ($LSV, $LSN) = $temp =~ m/^.*: (\w+).*: (\w+)/s;
print "LSV: $LSV\nLSN: $LSN\n";