in reply to examine cell's content in HTML::TableExtract
At first, I was wondering why you were having trouble, as HTML::TableExtract pulls all the data into a structure for you. Then I tried whipping up a simple example, and found that I couldn't edit the data in-place, as I expected to be able to.
To get around that, I simply made a temporary array to hold the data. From there I could manipulate the data and do whatever with it:
# Copy all the data from the table into @tbl my @tbl; push @tbl, [ @$_ ] for $table->rows; # Now edit the data any way you like: for my $r (0 .. $#tbl) { # Make the first column ALL UPPERCASE $data[$r][0] =~ tr/a-z/A-Z/; ... more editing, as desired ... } # print it for my $rox (@tbl) { print join(";", @$rox), "\n"; }
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|