	#!/usr/bin/perl
	#
	# Sample connection oriented server using Perl
	#

	#open files for reading traces & writing filtered
	$s = "new.trc.new";
	open(NEWFILE,">$s") || die "$s is not found.";
	
	
	#process all files in directory with extension ".trc"
	foreach $file (<*.trc>) {
       	open(TRACES, $file) || die "$f will not open.";
		print "\nOpened: ". $file;

		while(<TRACES>) { # takes data from $file
			chop($_);#if(substr($_, -1, 1) eq '\n'){}
			substr($_, 9, 1) = " ";
			if($_ !~ /\?|cgi\-bin/){$pom = "1";}else{$pom = "0";}
			print(NEWFILE $_," <<<<<<<<< >>>>>>>>> $pom\n");
		}
		close(TRACES);
    }
	close(NEWFILE);
	print "\nClosed: ". $s;
	
