Changing your subuser to use printand purgeinstead flushfixes the problem:
sub cd_catalogue {
my( $t, $cd_catalogue ) = @_;
$cd_catalogue->print;
$cd_catalogue->purge;
}
flushconfused because of the simplicity of your example, because it cd_catalogueis the root node. If you change your data to the following:
my $string = '
<cds>
<cd_catalogue><title>Hello, World!</title></cd_catalogue>
</cds>';
or if you changed your twig_handler to search title:
twig_handlers => { title => \&cd_catalogue }
then you will find that it $cd_catalogue->flushnow works as expected with yours $string.
/ I3az /
source
share