in reply to Simple Syntax Error? Can't Find?

Strange. I pasted you code into a file and it syntax checks clean:

C:\test>type junk.pl #!/usr/bin/perl -w # vanillaPrimes.pl use strict; my $divider; # Used for testing file. open FILE, "<", "DATA1.txt" or die $!; # Open a file or return error. open oFILE, "+>>", "OUT1.txt" or die $!; # Used to write answer. my $numInput = <FILE>; # Getting the line from file. chomp($numInput); # removing a newline, just in case. my $half; if($numInput % $divider == 0){ $half = $numInput/2 } else { $half = ($numInput - 1)/2 } foreach($divider..$half){ if($numInput % $divider == 0){ print oFILE "not"; } else { print oFILE "prime"; } } close(FILE); close(oFILE); C:\test>perl -c junk.pl junk.pl syntax OK

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.