Let's say I've got some strings with Ruby code to be eval'ed, like:

evalstr = 'puts "this is the string"'

and let's say I want to get the part that's sent to STDOUT (by puts) and 
capture it in a string, like so:

outputStr = eval evalstr #=> outputStr = "this is the string"

I suspect I could do this by redefining 'puts', but is there a way of 
doing it so that puts is only redefined within the context of the eval?
Like:

puts "this is the regular puts"
outputStr = eval 'puts "this string gets returned from special puts"'

Oh, now that I typed all of this in , I suspect I could do something with 
the binding argument that gets passed into eval as an optional 2nd 
parameter....

Phil