Re: Fwd: re: [MacPerl-WebCGI] A v B = ?

[email protected] Fri, 9 Mar 2001 17:47:54 -0500
Newsgroups perl.macperl.webcgi
Message-ID <p05010400b6cf0a23064e@[64.194.142.225]>
>  >The script which
>>  will run, and do what is intended, it will NOT run with the "-w" option
>
>run with the '-w' flag, gives the error:
>#  Can't find string terminator "    DB" anywhere before EOF. File 'test';
>Line 10
>
>line 10 was:
>	print <<"    DB";
>
>As per the FAQs I checked for common errors with '<<here' docs and found
>the corresponding tail tag wasn't the same - it had 1 space too many, so I
>took away the xtra space, the error disappeared, but I got another which
>was:
># Can't find string terminator "    ROW" anywhere before EOF. File 'test';
>Line 34
>
>line 34 was:
><<"    ROW";
>
>On a hunch I assumed the corresponding tail tag wasn't the same , so I took
>away 1 space, the error disappeared and the script then ran as expected.


Well... this is news to me. You see, if I use the -w "option", I 
don't get any feedback at all -- all I get is:

--- quote
Internal Server Error

The server encountered an internal error or
misconfiguration and was unable to complete your
request.
--- un quote

This could mean the error you found, or a missing ";", or hundreds of 
other things. If I could have my reported errors more specific, then 
it would help a lot.

>So what, you say, it ran anyway without the '-w' switch. Sure but supposing
>you added more parts to the script and suddenly it stops working because
>the interpreter thinks whatever comes after the '<<here' doc is part of the
>'<<here' doc because it hasn't found the tail tag. It's another 'subtle'
>bug like not using || die( )in the open() statement. Point being, without
>the '-w' switch you just won't see certain errors. Having said all that,
>sometimes you have to do stuff just to keep '-w' happy, but that's the
>price you pay for being able to eliminate all kinds of probs very early on
>before things get complicated.
>
>to paraphrase you:
>if a airplane doesn't explode in flight, but an engine drops off due to
>faulty maintenance, the plane'll land and deliver its passengers, but they
>won't necessarily be grateful to the airline.
>
>Robin

Robin -- I fully understand the importance of clean code -- I've been 
programming for over 20 years. However, I haven't run into too many 
programs that will run, but won't compile -- that's a new concept to 
me.

Now, I've tried to run the code on both my Mac (under MacPerl) and my 
server and both run without problems. However, when I add the -w to 
the cgi on my server, it doesn't run, but it also doesn't give me a 
descriptive error. When I run it on my Mac, it runs without problems 
even with the -w. So, where is it that you're running the code and 
receiving those errors?

tedd
-- 
http://sperling.com/