3 my $src_name = shift; # source file to be read
4 my $tgt_name = shift; # change file to be created
6 open (my $fh_src, '<'.$src_name) or die "Error: " . $src_name;
7 open (my $fh_tgt, '>'.$tgt_name) or die "error: $!";
12 print $fh_tgt "% This is part of LFSbookja package.\n";
14 print $fh_tgt "% This is a CTIE change file for the original XML source of the LFSbook.\n";
17 foreach my $line (<$fh_src>) {
19 if ($line =~ /^[ \t]*$/) {
21 &output_change_strings;
25 $lines = $lines . $line;
29 &output_change_strings;
35 sub output_change_strings {
37 if ($lines =~ /[\n]$/) {
42 print $fh_tgt "\@x\n";
43 print $fh_tgt $lines . $last;
44 print $fh_tgt "\@y\n";
45 print $fh_tgt $lines . $last;
46 print $fh_tgt "\@z\n";