http://www.perlmonks.org?node_id=11101273

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello,
I'm not able to fill a string as in the example below with Text::Template. Where is the mistake?
Thanks
use strict; use Text::Template; my $user_info = 'u1'; my $site = 'a'; my $string = './{$user_info}.{$site}.txt'; my $template = Text::Template->new(TYPE =>'STRING',SOURCE=>$string); $string = $template->fill_in({site=>$site,user_info=>$user_info}); print "$string\n";