in reply to Re^5: duplicate table with HTML::TreeBuilder look_down method
in thread duplicate table with HTML::TreeBuilder look_down method

If I try to loop through the @tds I still get arrayref. Code:
foreach my $td (@tds) { say $td; }
Output:
ARRAY(0x2a70c90) ARRAY(0x2a705b8)

Replies are listed 'Best First'.
Re^7: duplicate table with HTML::TreeBuilder look_down method
by jeffa (Bishop) on May 15, 2015 at 17:34 UTC

    That is because you are working with a two dimensional array. You are very close, you just need to further dereference the variable $td

    foreach my $td (@tds) { say for @$td; }
    However ... what are you going to do with the results, which are bits of HTML stored as strings?

    You most likely need something more like this:

    Output:

    $VAR1 = [ { 'Actual Start' => undef, 'Node Name' => 'ServerB', 'Results' => undef, 'Schedule Name' => 'DAILYBACKUP_6PM', 'Schedule Start' => '2015-05-11-18.00', 'Domain Name' => 'ST10_DOMAIN', 'Status' => 'Missed' }, { 'Schedule Start' => '2015-05-11-18.00', 'Results' => undef, 'Domain Name' => 'ST13_DOMAIN', 'Schedule Name' => 'NJDLYBACKUP_6PM', 'Status' => 'Missed', 'Node Name' => 'ServerC', 'Actual Start' => undef } ];

    (See emulate Python's range function for more information about the range() function included in the code.)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      It is to extract the class tags with Warning and Error in a very, very long html report and print only the Warning/Errors. Extracting the values and dump them into array is something I had in mind, thanks a lot Jeff!! (And I don't know you can emulate range function!)