in reply to Reading and writing data to text file and to table
subroutine{ my @data; my $table; open( F, "$File" ) || die("Could not open $File"); while (<F>) { chomp(); push( @{@data[$.]},( split /,/, $line)); } close(F); $table .= "<table border=1>"; for my $i ( 0 .. $#data ) { $table .= "<tr>"; for ( @{@data[$i]}){ $table .= "<td>$_</td>\r\n"; } $table .= "</tr>"; } $table .= "</table>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading and writing data to text file and to table
by learner@perl (Novice) on Jul 03, 2013 at 06:51 UTC | |
by learner@perl (Novice) on Jul 03, 2013 at 07:11 UTC |