You can find String :: TT as the best alternative way to do this. Some teasers from the pod ...
use String::TT qw/tt strip/; sub foo { my $self = shift; return tt 'my name is [% self.name %]!'; } sub bar { my @args = @_; return strip tt q{ Args: [% args_a.join(",") %] } }
and...
my $scalar = 'scalar'; my @array = qw/array goes here/; my %hash = ( hashes => 'are fun' ); tt '[% scalar %] [% scalar_s %] [% array_a %] [% hash_h %]';
source share