#!/usr/bin/perl
-foreach $file ( split(/\n/, `find . -depth -print | grep cgi\$`) ) {
+foreach $file ( split(/\n/, `find . -depth -print`) ) {
+ next unless $file =~ /(cgi|html)$/;
open(F,$file) or die "can't open $file for reading: $!";
@file = <F>;
#print "$file ". scalar(@file). "\n";
system("chmod u+w $file");
open(W,">$file") or die "can't open $file for writing: $!";
select W; $| = 1; select STDOUT;
+ $newline = ''; #avoid prepending extraneous newlines
$all = join('',@file);
$mode = 'html';
#die;
next;
} elsif ( $all =~ /^<%(.*)$/s ) {
- print W "\n";
+ print W $newline; $newline = "\n";
$all = $1;
$mode = 'perlc';
next;