in reply to Re^3: Problem extracting an HTML table with Perl
in thread Problem extracting an HTML table with Perl

I had missed that of the find. I now found that I chose the wrong tag given that I wanted the list that shows after this tag, but I'll get to that later.

Indeed I now see that I cannot dd $data as it dumps everything - the print $data->as_HTML solves the problem. One more question: in your second example, how did you print the data?

Thanks so much!

  • Comment on Re^4: Problem extracting an HTML table with Perl

Replies are listed 'Best First'.
Re^5: Problem extracting an HTML table with Perl
by kennethk (Abbot) on Aug 11, 2014 at 18:22 UTC
    For the list context call, I actually only output
    print 0+ @data;
    to tell me the length of the array. If I wanted to print both terms, I'd either use a map and a join
    print join "\n", map $_->as_HTML, @data;
    or just use Foreach Loops:
    for my $datum (@data) { print $datum->as_HTML, "\n"; }

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.