#!perl -w use strict; my $debug = shift || 0; open(PPERL, ">pperl.h") || die "Can't write to pperl.h: $!"; open(PPERL_HEAD, ") { last if /#### Your Code Here ####/; s/^\s*log_error.*// # lose log_error calls unless $debug; s/\\/\\\\/g; # double up all backslashes s/"/\\"/g; # backslash all quotes s/^(.*)$/"$1\\n"\\/; # wrap in quotes print PPERL $_; } } spool(); print PPERL << 'EOT'; "\n" #define perl_footer ""\ EOT spool(); print PPERL << 'EOT'; "\n" EOT my $version = `grep 'VERSION =' PPerl.pm | cut -d"'" -f2`; chomp($version); print PPERL '#define PPERL_VERSION "'. "$version\"\n"; close PPERL; close PPERL_HEAD;