in reply to Printing with CGI.pm

Well, print header() prints the Content type.... I would move it outside your loop...

Replies are listed 'Best First'.
Re: Re: Printing with CGI.pm
by cal (Beadle) on Jul 20, 2002 at 20:11 UTC
    Thanks,
    When I move the print header(); outside of the loop I loose all the HTML formatting. I just get the data from the text file. Is there a particular way to do this?
    Cal
      In your original code, you have one long print statement. When you moved the print header() outside of the loop, did you forget to leave a print statement inside the loop? You may want to move the start_html() out of the loop, as well. Some other thoughts:
      • As your code is right now, it looks like you'll get each line in a separate table. Is that What You Want?
      • Your code might look better if you were to use CGI.pm's table functions (table, td, Tr, etc.), which you already have imported by using :standard. I refer to Lincoln Stein's Official Guide to Programming wth CGI.pm. I'm sure there are online resources for this; I've just never looked.
      HTH

      --

      There are 10 kinds of people -- those that understand binary, and those that don't.