String::Divert is small Perl 5 module providing a scalar-like string object with some overloaded operators, supporting the concept of Folding and Diversion. This allows nested generation of structured output. The idea is to decouple the sequential generation of output from the nested and non-sequential structure of the output. WWW: http://search.cpan.org/dist/String-Divert/