|
| Hi. I've searched to no avail through CPAN for a module that can
convert a delimited block of text into an HTML table, and then modify
cell, row, and column attributes. I probably simply overlooked it by
using the incorrect search parameters on CPAN. I'm guessing that
there must be a module out there that can do something such as this.
The HTML::Table module appears to be a good module, and I guess I
could always loop through my text block in my main script, and then
use this module to specify specific attributes for each cell. I'd
rather, though, be able to pass the entire text block as part of an
object attribute, and then simply call specific methods within a
module to act on the object (I hope I explained this reasonably well,
and I hope I'm not misunderstanding how HTML::Table really works). For
example, I'd like to be able to do something such as this:
--------------------------------------------------------------
#!/perl -w
use strict;
use diagnostics;
my @data = qw(
Column 1|Column 2|Column 3
Row 2-1|Row 2-2|Row 2-3
Row 3-1|Row 3-2|Row 3-3
Row 4-1|Row 4-2|Row 4-3
);
my %attrs = (
file => ['D:\perl\test.html', '>'],
delimiter => '|',
padnulls => 0,
default_fill => undef,
alternate => undef,
alternate_start => undef,
alternate_colors => undef,
alternate_stop => undef,
table => [@table],
attrs_dir => 'D:\perl',
type => 'td'
...
...
...
);
my $html = Transform->new(%attrs);
$html->setCell(position => [3,1],
bgcolor => 'magenta',
new_data => undef);
$html->setRow(row => 3,
bgcolor => 'white',
new_data => ["new cell1|new cell2|new cell3"]);
--------------------------------------------------------------
Does anyone know of such a module?
Thanks very much.
JR
|
|