in reply to How to store the output of the process in my own array?

a quick search through the docs would suggest doing
$exp->log_stdout(0); my $output = $exp->before();
but that's just a guess which works with a simple command; have a further look at the documentation, i don't have experience with Expect.pm