home *** CD-ROM | disk | FTP | other *** search
- # Process argument list of files along with any includes.
-
- foreach $file (@ARGV) {
- &process($file, 'fh00');
- }
-
- sub process {
- local($filename, $input) = @_;
- $input++; # this is a string increment
- unless (open($input, $filename)) {
- print STDERR "Can't open $filename: $!\n";
- return;
- }
- while (<$input>) { # note the use of indirection
- if (/^#include "(.*)"/) {
- &process($1, $input);
- next;
- }
- ... # whatever
- }
- }
-