corpx has asked for the wisdom of the Perl Monks concerning the following question:
I only want to print $row->[7]->as_text if such a cell exists in the table. I tried exists to check for this, but that does not work. How could I make that if statement work?$agent->get($url); $page = $agent->content; $te = new HTML::TableExtract(); $te->parse ($page); @ts = $te->table_states; $ts = $ts[3]; #4th table on the page @table = $ts->rows; for $row ( @table[1..$#table] ) { if ( exists $row->[7] ) { print $row->[7]->as_text; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to check if an array element reference exists or not
by Anonymous Monk on Apr 14, 2010 at 08:38 UTC | |
by corpx (Acolyte) on Apr 14, 2010 at 08:52 UTC | |
by Corion (Patriarch) on Apr 14, 2010 at 08:57 UTC | |
by corpx (Acolyte) on Apr 14, 2010 at 09:16 UTC | |
by almut (Canon) on Apr 14, 2010 at 09:26 UTC | |
| |
by Corion (Patriarch) on Apr 14, 2010 at 09:23 UTC | |
|