lakeTrout has asked for the wisdom of the Perl Monks concerning the following question:
Also, I think I can just do print to >>WHATEVER instead of all of the OUTFILE calls right?#!/usr/bin/perl open(OUTFILE, ">results.html"); print OUTFILE "<html><head>"; print OUTFILE "<title>Summit Results</title>"; print OUTFILE "</head>"; print OUTFILE "<body>"; print OUTFILE "<table border='1'>"; print OUTFILE "<tr>"; print OUTFILE "<td>Company</td>"; print OUTFILE "<td>Address</td>"; print OUTFILE "<td>Name</td>"; print OUTFILE "<td>Email</td>"; print OUTFILE "<td>Phone</td>"; print OUTFILE "<td>fjskdfjskla</td>"; print OUTFILE "<td>fjsdklfja</td>"; print OUTFILE "<td>fhjsdhfj</td>"; print OUTFILE "<td>Pfjdskl</td>"; #... there's 25 fileds print OUTFILE "</tr>"; open (FF,"mylogfile.log") or die("There was a problem opening the file +."); while ($entry=<FF>) { @fields=split(/ /,$entry); print OUTFILE "<tr>"; print OUTFILE "<td>$fields[0]</td>"; print OUTFILE "<td>$fields[1]</td>"; print OUTFILE "<td>$fields[2]</td>"; print OUTFILE "<td>$fields[3]</td>"; print OUTFILE "<td>$fields[4]</td>"; print OUTFILE "<td>$fields[5]</td>"; print OUTFILE "<td>$fields[6]</td>"; print OUTFILE "<td>$fields[7]</td>"; print OUTFILE "<td>$fields[8]</td>"; print OUTFILE "<td>$fields[9]</td>"; #... there's 25 fileds print OUTFILE "</tr>"; } close DB; print OUTFILE "</table>"; print OUTFILE "</body>"; print OUTFILE "</html>"; close OUTFILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print Flat File to HTML
by naikonta (Curate) on Nov 20, 2007 at 06:51 UTC | |
|
Re: Print Flat File to HTML
by jZed (Prior) on Nov 20, 2007 at 06:49 UTC | |
|
Re: Print Flat File to HTML
by andreas1234567 (Vicar) on Nov 20, 2007 at 06:48 UTC | |
by lakeTrout (Scribe) on Nov 20, 2007 at 07:04 UTC | |
|
Re: Print Flat File to HTML
by GertMT (Hermit) on Nov 20, 2007 at 07:10 UTC | |
by lakeTrout (Scribe) on Nov 20, 2007 at 07:17 UTC |