Added a complete and an incomplete Perl 6 solution.

The complete solution works exactly as per the rules.
Conceptionally it's rather simple, the result is created
by appending to a dynamic variable, which is looked up
through the caller. This is functionally similar to a
global variable in this code. Resetting the dynamic
variable happens with a boolean mixin, which make it
get reinitialized on repeated calls.

I am calling the incomplete solution incomplete, because I
have not yet been able to make it work without the sigil.
It works by assign the string 'g' to a variable and mixing
in a role that implements the postfix operator () and return
a string with a different role mixed in, which implements the
same operator differently, to create the correct output.