(Perl) build messages from templates