ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/doc/include_html.pl
Revision: 1.1
Committed: Fri Feb 3 07:12:02 2006 UTC (18 years, 3 months ago) by root
Content type: text/plain
Branch: MAIN
Branch point for: UPSTREAM
Log Message:
Initial revision

File Contents

# User Rev Content
1 root 1.1 #!/usr/bin/perl
2    
3     # basic
4    
5     $in = $ARGV[0];
6     $out = $ARGV[1];
7     sub die {
8     $prog = $0;
9     print STDERR $prog.": ".$_[0]."\n";
10     exit(1);
11     }
12    
13     open(FOUT,">".$out) || &die("cannot open ".$out);
14    
15    
16     sub include_file {
17     $in = shift;
18     local(*FIN);
19     open(FIN,"<".$in) || &die("cannot open ".$in);
20     while (<FIN>) {
21     if (/^<!--#include file="(.*)"-->$/) {
22     &include_file($1);
23     }
24     else {
25     print FOUT $_;
26     }
27     }
28     close(FIN);
29     }
30    
31     &include_file($in);
32     close(FOUT);
33