in reply to capturing the output of eval()

I'd suggest you read the thread Redirecting STDOUT to a variable via eval?.