Files
shard-wiki/history/priorart/yawex-0.7.4/tools/striptests

45 lines
821 B
Perl
Executable File

#!/usr/bin/perl -w
#
# comments out package inclusion of Test::Unit from perl sources
#
# $Header: /var/local/cvs/yawex/tools/striptests,v 1.1.1.1 2004/07/15 18:37:24 bernd Exp $
#
$pattern = "use Test::Unit";
$usage =<<EOT;
usage:
striptests <file>
EOT
unless ($ARGV[0]) {
print $usage;
exit 0;
}
foreach $filename (@ARGV) {
unless (-f $filename) {
print "skipping $filename - file not found\n";
next
}
if ($filename =~ /\.pm/ || $filename =~ /\.pl/) {
print "processing $filename\n";
} else {
print "skipping $filename - not a perl file\n";
next
}
open INFILE, "<$filename";
open OUTFILE, ">$filename.mod";
while (<INFILE>) {
s/$pattern/\#$pattern/g;
print OUTFILE;
}
close INFILE;
close OUTFILE;
system "mv $filename.mod $filename";
}