lapsan has asked for the wisdom of the Perl Monks concerning the following question:
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?):Then, I'm printing the opening HTML, beginning an HTML table and doing the following:open (INDATA, "master.job.list") or die "Couldn't read file $!\n"; while (<INDATA>) { @temp = split/:/; push @data, [ @temp ]; } close (INDATA);
Of course, I'm closing the HTML and all that.$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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Odd HTML printing - Perl's fault?
by Fastolfe (Vicar) on Oct 25, 2000 at 00:04 UTC | |
|
Re: Odd HTML printing - Perl's fault?
by AgentM (Curate) on Oct 25, 2000 at 00:11 UTC | |
|