- "WARNING: You will not be able save, because your webserver cannot write to '$file'. Contact your admin about help file permissions.";
- open (INFILE, $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked
- my $help = '';
- while ( my $inp = <INFILE> ) {
- unless ( $inp =~ /TMPL\_INCLUDE/ ) {
- $help .= $inp;
- }
- }
- close INFILE;
- $template->param( 'help' => $help );
+ "WARNING: You will not be able to save, because your webserver cannot write to '$file'. Contact your admin about help file permissions.";
+ open (my $fh, '<:encoding(utf-8)', $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked
+ my $help = '';
+ while ( <$fh> ) {
+ $help .= /\[% INCLUDE .* %\](.*)$/ ? $1 : $_;
+ }
+ close $fh;
+ $template->param( 'help' => $help );