Satanya has asked for the wisdom of the Perl Monks concerning the following question:

Hello Perl Monks,

I am getting a syntax error that I do not understand. I don't know why I keep getting this error.

Any info would be apreciated.

here is a part of my code:

11 # setup 12 require 5.003; 13 14 use CGI; 15 use strict; 16 17 package main; 18 19 #unbuffer my output 20 $| = 1; 21 22 $main::cgi = new CGI; 23 { 24 25 SendTheDRAMail(); 26 SendTheDRASuccessPage(); 27 }

Here is the error I am recieving:

syntax error at dra_feedback.cgi line 12, near "require "

BEGIN not safe after errors--compilation aborted at dra_feedback.cgi line 14.

Replies are listed 'Best First'.
Re: Syntax errors when I am using require
by kjherron (Pilgrim) on Sep 05, 2001 at 22:18 UTC
    Are any of lines 1 through 10 not comments? Your syntax error may be on the line of code preceeding the require line, e.g. you may have forgotten the semicolon.
Re: Syntax errors when I am using require
by dragonchild (Archbishop) on Sep 05, 2001 at 22:21 UTC
    In my experience, over half of all syntax errors are on the line before the line mentioned. So, I'd look at the last line of code prior to line 12. And, as the previous poster mentioned, 90% of those are missing semi-colons.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Vote paco for President!

      Ohh thanks.. It was a stupid mistake. All the above lines were supposed to be comments. However, I accidentally deleted a # sign from before one comment.

      Thanks again for your help.

      Ever greatfull newbie.

      Satanya