# set a [puts foo]
does not execute the bracketted puts. So I'd be interested what your code boils down to when you strip out everything nonessential to reproducing this behavior.