#!/usr/bin/perl -w my @raw_data; my $wrestler; my @work_array; my $wrestlerPrevious = ''; print "Starting Program......Hopefully.....\n"; open (sortedFile, "Out.txt") || die ("Could not open file. $!"); print "File sortedFile openend successfully \n"; @raw_data = ; print "stored entire file in Array \n"; close (sortedFile); print "closed file sortedFile \n"; print "\n"; print "trying to enter foreach....\n"; print "\n"; #====================================================================================== foreach $wrestler (@raw_data) { print "entered foreach successfully \n"; #print $wrestler, "\n"; #@work_array = $wrestler; #print "trying to enter if Condition....\n"; if ($wrestler !~ m/$wrestlerPrevious/) { print "if condition entered successfully\n"; open (cleaned_Blasthits_wo_AlignmentsFile, ">>cleaned_Blasthits_wo_AlignmentsFile.txt") || die ("Could not open file. $!"); print "File cleaned_Blasthits_wo_AlignmentsFile opend successfully \n"; print cleaned_Blasthits_wo_AlignmentsFile $wrestler; close (cleaned_Blasthits_wo_AlignmentsFile); } else { print "THAT WAS A DOUBLED ONE....SORRY \n"; } $wrestlerPrevious = $wrestler; } print "finished foreach \n";