#!/usr/bin/perl my $t = ""; my $fil = ""; foreach () { chomp; if (/^.LITERAL/) { s/^.LITERAL.//g; s/.$//g; $fil = $_; $t = '\subsection{' . $fil . '}' . "\n\n" . '\begin{verbatim}' . "\n"; $fil = "appendix/" . $fil; print $t; open(INCFILE,"<$fil") || die "FILE MISSING: $fil\n"; print STDERR "Including file $fil\n"; if (($fil =~ /[.]pl/) || ($fil =~ /[.]html/)) { print STDERR "HTML or Perl file\n"; } else { print STDERR "Normal file, converting tabs to semicolons\n"; print "Converted tabstops to semicolons to show parsemarks\n\n"; } foreach () { chomp; # s/ //g; # does not look good for != sent/fill if (($fil =~ /[.]pl/) || ($fil =~ /[.]html/)) { # do not change anything with HTML or Perl files... } else { s/[ ]* [ ]*/;/g; # convert (spaces)tab(spaces) to ; } print "$_\n"; } close(INCFILE); $t = "\n\n" . '\end{verbatim}' . "\n\n"; print $t; } else { print "$_\n"; } } print "% EOF\n";