dHarry has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks
I have to generate three versions of a directory structure and a number of ASCII files. For each version of the structure the ASCII files are slightly different. I first approached this by reusing some code I wrote in the past. I use heredocs as templates and Perl interpolation to populate them with the correct values. I also use some external ASCII files as templates and process them with some Perl code.
The script works as intended but now it has grown to 2500 lines and I begin to regret the approach. A better solution is obviously to use separate ASCII template files for everything and get rid of the heredocs altogether. I have looked on CPAN but I see about a zillion template modules.
I just need something simple. Replace some values in ASCII files. The template toolkit looks like overkill, maybe Text::Template or Text::Template::Simple? I’m a bit overwhelmed by the number of template modules.
Anybody out there having (good) experience with a simple CPAN template module?
Cheers dHarry
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Wanted, template module
by Corion (Patriarch) on Mar 06, 2009 at 09:43 UTC | |
|
Re: Wanted, template module
by mirod (Canon) on Mar 06, 2009 at 12:12 UTC | |
|
Re: Wanted, template module
by rovf (Priest) on Mar 06, 2009 at 09:49 UTC | |
|
Re: Wanted, template module
by Tanktalus (Canon) on Mar 06, 2009 at 18:24 UTC | |
|
Re: Wanted, template module
by dsheroh (Monsignor) on Mar 06, 2009 at 14:57 UTC |