X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=edithelp.pl;fp=edithelp.pl;h=5cde3149d49a706f73fe6e41bfae0dc74c743593;hb=ef5d4d7bf8caf84c917fdbcd22005767b6f9e960;hp=32db0622915cd56b101fa9ef0e2aee663c0cf46a;hpb=f9fdf43043d78e60b5ff5a16773b7f8662da79fd;p=koha.git diff --git a/edithelp.pl b/edithelp.pl index 32db062291..5cde3149d4 100755 --- a/edithelp.pl +++ b/edithelp.pl @@ -97,14 +97,12 @@ elsif ( $type eq 'modify' ) { } else { (-w $file) or $error = "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 + open (my $fh, '<', $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked my $help = ''; - while ( my $inp = ) { - unless ( $inp =~ /INCLUDE/ ) { - $help .= $inp; - } + while ( <$fh> ) { + $help .= /\[% INCLUDE .* %\](.*)$/ ? $1 : $_; } - close INFILE; + close $fh; $template->param( 'help' => $help ); $type = 'save'; }