Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

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

Well, I think your question is a little unclear to me, but I'll try and do a spot of guesswork and shoot in a few directions... just a reminder: try to preview before you submit a question, a bit of punctuation and a few paragraph <p> tags here and there could help a lot

If I understand correctly, your scenario is that you've written a CGI script, which generates HTML (using print statements or heredocs)..

Now this posting is a great place to start reading on why you need to put your HTML in a different file.. quite simply, you want to separate your code from your presentation (HTML) because that makes it easier to maintain... if someone asks you to do minor changes to the HTML, then you need to dig through all of your code to find out the place to change, and you could actually break some of your code in the process...

Another thing, if you separate your HTML into another file, someone who doesn't know Perl well, but who does know HTML could actually figure out what to do, and fix it..

Another option that I think you mention is to generate an HTML file and display that on the webserver, rather than a CGI script.. (correct me if I didn't guess right).. well, you could do this, but then your content would no longer be dynamic, it would have to rely on your CGI script executing periodically and regenerating your HTML file.. if you need to display something that doesn't change very often, or if it does not need to be customized by individual viewers of your site (for example, a site like Perlmonks has to be customized and dynamic because different users have different views of the content on the site), then generating static HTML pages will mean that the webserver doesn't have a lot of overhead running a CGI script..

I hope this answered your question.. if you need any clarification or if I didn't answer what you needed to know, please reply on this thread...


In reply to Re: Separation of content and code by tinman
in thread Separation of content and code by Draff

Title:
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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (4)
    As of 2020-07-08 05:00 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?