#!/usr/bin/perl -w
open(FILEIN,"<file_list");
@all_files = <FILEIN>;
close FILEIN;
system ("mkdir temp");
foreach $a (@all_files)
{
open (FILETEMP,"< $a");
@lines = <FILETEMP>;
close FILETEMP;
open(FILEOUT,"> ./temp/$a");
foreach (@lines)
{
if (/\/\/.*/)
{s/\/\/.*//g;}
if ((/\/\*/) && (/\*\//))
{
s/\/\*.*\*\///g;
$flag=0; $type=0;
}
if (/\/\*/)
{
$flag=1; $type=1;
}
elsif (/\*\//)
{
$flag=1; $type=0;
}
else
{$flag=0;}
if (($flag==0) && ($type==0))
{
print FILEOUT "$_";
}
}
close FILEOUT;
}
|