Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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

In reply to Re: Question about this simple CGI by kcott
in thread Question about this simple CGI by Chaotic Jarod

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (4)
    As of 2018-01-21 07:14 GMT
    Find Nodes?
      Voting Booth?
      How did you see in the new year?

      Results (227 votes). Check out past polls.