in reply to Divert STDOUT temporarily
If output is not going to an explicit filehandle but to the default filehandle (which happens at that moment to be STDOUT), then select may be of interest.
Give a man a fish: <%-{-{-{-<