SamCG has asked for the wisdom of the Perl Monks concerning the following question:
Any help appreciated Thanks Sam#First, set a bunch of semi-constants (apologies to those offended by +the lack of conventions here). $tdo = "<td>"; $tdc = "<\/td>"; $tblo = "<table width=\"525\" border=\"0\" cellpadding=\"5\" cellspaci +ng=\"0\">"; $hro = "<tr bgcolor=\"#0065ce\">"; $rc = "<\/tr>"; $ro = "<tr>"; $htd = "<td valign=\"top\"><b><font size=\"2\" color=\"white\" face=\" +Arial,Helvetica,Geneva,Swiss,SunSans-Regular\">"; $htdc = "<\/font><\/b>".$tdc; ## Now the actual working code $time=0; $Response->write($tblo); ## Write table (works) $filename = $Server->MapPath('./data/test.dat'); ## map file open(fileREAD, $filename); #open file (works) while ($line = <fileREAD>){ $rtype = ""; @array = split "\t", $line; $rtype = pop @array; $time ++; $Response->write("<tr><td>line = ".$line."&".$rtype."&".$time."<\/td>< +\/tr>"); ## t-shoot #$Response->write("rtype = ".$rtype); if ($rtype = "header "){ $Response->write($hro); foreach (@array){ #$Response->write("<tr><td>line = ".$line."&".$rtype." +&".$time."<\/td><\/tr>"); $Response->write($htd.$_.$rtype.$htdc); #$Response->write("<tr><td>line = ".$line."&".$rtype." +&".$time."<\/td><\/tr>"); } } elsif ($rtype = "row "){ $Response->write($ro); foreach (@array){ $Response->write($td.$_.$tdc); } } $Response->write($rc);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perlscript ASP page responds strangely
by meetraz (Hermit) on Nov 11, 2003 at 23:38 UTC | |
|
Re: Perlscript ASP page responds strangely
by Roger (Parson) on Nov 11, 2003 at 23:56 UTC |