#!/usr/bin/perl -w my @raw_data; my $wrestler; my @work_array; print "Starting Program......Hopefully.....\n"; open (bigShot, "BigOne.txt") || die ("Could not open file. $!"); print "File bigShot openend successfully \n"; @raw_data = ; print "stored entire file in Array \n"; close (bigShot); print "closed file bigShot \n"; print "trying to enter foreach....\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/^>sp/ || $wrestler =~ m/^Query/ || $wrestler =~ m/^Sbjct/) { print "if condition entered successfully\n"; open (cuttedFile, ">cuttedFile.txt") || die ("Could not open file. $!"); print "File cuttedFile opend successfully \n"; print $wrestler; close (cuttedFile); } } print "finished foreach \n";