You can fork, eval in the child, and capture the output in the parent.
You can use open to dup the original STDOUT and STDERR somewhere else, tie STDOUT and STDERR (eg with IO::Scalar), eval, untie and replace with the originals.
In reply to Re (tilly) 1: capturing the output of eval()
by tilly
in thread capturing the output of eval()
by tmbg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |