[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] compiling error



Hello !

Sadie O. McFarlane wrote:
> 
> ...  Can someone look at the first few lines
> of my code and tell me what is the problem?  I'll be forever indebted...

 No problem ...  ;-)

> 
> #!/usr/local/bin/perl
> #---------------
> #program for sending form results
> #------------
> 
> $mailprog = '/usr/lib/sendmail'
                                 ^
                       semicolon ';' missing
> 
> print "Content-type: text/html\n\n";
> 
> if ($ENV{'REQUEST_METHOD'} eq "get") { $buffer = @ENV{'QUERY_STRING'}: }
                                                                       ^
                                     this should be a semicolon ';', too
> else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); }

 As you have "NO experience with ANY Perl", just one hint: in perl
 every function, operation,... has to be terminated by a semicolon ';'
 (like in C). You can leave it out at the end of a 'block' which means
 'before a closing brace' - in your case semicolons in the blocks after
 'if' and 'else' are not really necessary, but not forbidden.


 Hope this helps, Eike

=====================================================================
 Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
            email : eike.grote@theo.phy.uni-bayreuth.de
         URL : http://btrzxa.fddi.uni-bayreuth.de/~btpa25/
=====================================================================