OT for [EMAIL PROTECTED] - the answer is the same regardless of the OS you happen to be using. This would be more appropriate for a general Perl forum, perhaps comp.lang.perl.modules. Having said that...

On Dec 20, 2004, at 3:26 PM, Joseph Alotta wrote:

I am using the TableExtracter and it bombs in the line marked with ">>" when it don't match headers for the table.

Define "bombs". Do you get an error message? If so, what is it?

I would like to check to see if it matched, but I don't know what to check. Can someone please help me.

my $te = new HTML::TableExtract( headers => ["1 Year", "3 Year", "5 Year", "10 Year"] );
$te->parse($html);
>> my $p = ($te->rows)[0];

You're pretty much asking for errors here, by subscripting the return value from a method that might return an empty list. You should check it first:


my @table_rows = $te->rows();
if (@table_rows) {
    my ($one, $three, $five, $ten) = @{$table_rows[0]};
}

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org



Reply via email to