http://www.perlmonks.org?node_id=140318


in reply to format/write to variable

This is FAQ: How can I write() into a string?