Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Question about this simple CGI

by kcott (Abbot)
on Jul 20, 2013 at 08:54 UTC ( #1045433=note: print w/ replies, xml ) Need Help??


in reply to Question about this simple CGI

G'day Chaotic Jarod,

"... it says there is a syntax error on the end_html line,"

You appear to have resolved the issue; however, you may still be wondering why the error was reported as being on the syntactically correct "$q->end_html;" line.

Take a look at perldiag and search for:

  • syntax error

    (F) Probably means you had a syntax error. Common reasons include:

This will explain why the error is often reported after the point where the actual error occurred.

In this case, Perl ignores the comment you wrote (i.e. '#ffffff);') — as it obviously has no idea you didn't mean that to be a comment — and continues parsing your code until it reaches "$q->end_html;" where it gives up having found no valid end to '$q->start_html(...'.

While you're learning Perl, you might consider using the diagnostics pragma which will provide verbose output regarding problems you encounter. Be aware that this is a debugging aid and should not be left in production code (and that would include what you submit for your project).

Finally, if you're unable to resolve the error yourself, feel free to ask but do include the full error message when you post your problem.

-- Ken


Comment on Re: Question about this simple CGI
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045433]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (16)
As of 2014-07-30 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (231 votes), past polls