#!/usr/bin/perl use Template; my $template = Template->new(); my $input = q{[% "Blah, Blah," | replace(',$', '') %]}; $template->process(\$input) || die $template->error(); # output "Blah, Blah"