I have created a script (based on the chemiserie shopping cart script in Chapter 19 of the Cookbook) and have come across a problem. The problem is that, in Netscape anyway, the table I'm building (see the code below) is pushed way down the page in the browser instead of being rendered where it should at the top of the page.

I am pretty sure the distance down the page is related to the amount of time it takes to read in the file and generate the table based on the info in the file. Is there any way around this that anyone knows of? Is there a better way for me to do this?

(The results can be seen by visiting http://www.lapsan.com/intranet/scratch/test2.pl and clicking on "MasterList") ------ I'm reading in a file as follows (if this is wrong, could someone give me a heads up?):
open (INDATA, "master.job.list") or die "Couldn't read file $!\n"; while (<INDATA>) { @temp = split/:/; push @data, [ @temp ]; } close (INDATA);
Then, I'm printing the opening HTML, beginning an HTML table and doing the following:
$clientname_temp = ""; foreach $line (@data) { $clientname = $$line[0]; $jobnumber = $$line[1]; $description = $$line[2]; if ($clientname_temp ne $clientname) { print "<TR bgcolor='#ffffcc'><TD COLSPAN=4 bgcolor='#ffffcc'>< +B>$clientname</B></TD></TR>\n$ print "<TR><TD>EDIT DELETE</TD><TD><B>Job Number</B> = $jobnum +ber</TD><TD><B>Description</B$ } else { print "<TR><TD>EDIT DELETE</TD><TD><B>Job Number</B> = $jobnum +ber</TD><TD><B>Description</B$ } $clientname_temp = $clientname; }
Of course, I'm closing the HTML and all that.

In reply to Odd HTML printing - Perl's fault? by lapsan

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, details, 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, summary, 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.