in reply to Re^2: Embed a template in perl file
in thread Embed a template in perl file

My user base is less computer savvy and they tend to change the template files if they have access to them.

If they're smart enough to find the templates, I say they are computer savvy :D

Any what

#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw' pp '; use File::Slurp qw' read_file '; use autodie qw' chdir open '; chdir 'templates directory'; open my($fh), '>:raw', 'MahTemplates.pl'; select $fh; print '%templates = (', "\n"; for my $file ( glob '*.xml' ){ print dd( $file, scalar read_file( $file, { binmode => ':raw' } ) ), "\n"; } print "\n);\n"; close $fh;