Nik has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: CGI & Formatting
by Cody Pendant (Prior) on May 01, 2005 at 01:06 UTC

    Nik, Nikos, whatever your name is, I've seen you asking questions like this over and over again for the last few weeks, here and on newsgroups.

    You seem like a nice guy but there is something wrong with your understanding of the three types of code involved. You keep asking about problems with the appearance of your web pages as if Perl/CGI was responsible for the appearance. It isn't. HTML and CSS are responsible for the appearance.

    HTML is the language which describes the content of the page. CSS is the language which describes the appearance of the content. Your browser reads the HTML and the CSS and displays the page.

    Where does Perl enter the picture? Technically, it doesn't. Your browser doesn't know where the HTML comes from. It could be just a document with no programming at all, or it could be printed out to the browser by a Perl script, or PHP, or any one of a hundred languages. The browser doesn't know and it doesn't care. It just gets the HTML and CSS, and tries to display it.

    Your question above seems to be about the appearance of the page. This means that the page being read by the browser doesn't work the way you want it to.

    That means one of two things. Either
    A) You produced the HTML/CSS you wanted, (with Perl, but remember, it doesn't matter how it was produced), but the page you produced has an error, because you don't understand what the correct HTML and CSS for your desired page. Or,
    B) You know how to produce the right HTML and CSS for your page, but you got the Perl wrong and produced something which is not what you wanted.

    In neither of those cases, A or B, can we help you by seeing the Perl. We would have to see the full web-page you're trying to create. If you show us the URL of that web page, I can tell you why the HTML/CSS is or isn't working.

    I think most of your problems are problems of type A. It's not that you don't know how to create HTML with Perl, it's that you don't know how to create HTML with HTML.

    So here's the problem -- this is not an HTML/CSS website. it's a Perl website. Many of us can help you with your HTML/CSS problems, but it's not what this site is for, and your questions may be deleted for not being about Perl.

    Here's my suggestion. You post like this:

    1. Here's my web-page: (you put a URL here)
    2. I'm using this Perl script to create it: (you paste the whole script here, with READMORE tags)
    3. You ask us why your page doesn't look the way you want it to
    4. If people tell you "Your Perl is fine, but your HTML/CSS is broken", then you tell us "Here's the HTML I want Perl to create" and show us an example of HTML. We can then help you create the Perl to output the right HTML.
    But your main problem will be that you don't know how to do HTML and CSS, so you're always "working blind". The best thing you can do is to use a templating system, get someone else to write the HTML (or learn it yourself) and then use Perl to output the HTML from an external template file. You've been told this over and over...


    ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
    =~y~b-v~a-z~s; print
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: CGI & Formatting
by jhourcle (Prior) on Apr 30, 2005 at 19:01 UTC

    This may or may not be a Perl question. The real question is in where it went wrong. (wrong being completely subjective, when it comes to dealing with HTML)

    If the CGI didn't generate the HTML that you were expecting, then it's an issue with the script, so it's a Perl question. If the "correct" HTML doesn't generate the result as expected in the browser, then it's either an HTML or a browser issue. (yes, they're different things -- see quirksmode)

    Take the output of your script, then compare the results of it to what you were expecting. Modify the HTML until you get the browser results that you were expecting, check it against a validator to make sure it's valid HTML, and then modify the script so that it's producing the HTML that you want.

Re: CGI & Formatting
by Cody Pendant (Prior) on May 02, 2005 at 02:50 UTC
    When I suggested you posted the whole thing, I also suggested you use READMORE tags...


    ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
    =~y~b-v~a-z~s; print
    A reply falls below the community's threshold of quality. You may see it by logging in.