The Perl Toolchain Summit 2025 Needs You: You can help 🙏 Learn more

use strict;
use Test::More tests => 2;
use Text::MicroTemplate qw/render_mt/;
{
my $got = render_mt(<< '...')->as_string;
? $_mt->filter(sub { s/hello/hi/ })->(sub {
hello hyoshiok
? });
...
is $got, "hi hyoshiok\n";
}
{
my $got = render_mt(<< '...')->as_string;
? $_mt->filter(sub { $_[0] . 'roshi' })->(sub {
hi
? });
...
is $got, "hi\nroshi";
}