Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Question about this simple CGI

by kcott (Chancellor)
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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045433]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2018-05-26 06:27 GMT
Find Nodes?
    Voting Booth?