Re: Clearing table states

Matt Sisk <[email protected]> Fri, 25 Feb 2005 03:56:09 -0600
Newsgroups gmane.comp.lang.perl.modules.html-tableextract
Message-ID <[email protected]>
Hi Tim,

This answer is way too late I'm sure. But the workaround with version 
1.08 is to create a new TableExtract object each time you want to parse 
something.

Version 1.09, coming out soon, will automatically reset itself whenever 
you call the parse methods.

Matt

Tim Rushing wrote:

> I'm in the process of prototyping code that is going to run through 
> around 50,000 files, each containing data in a single html table.  I 
> like HTML::TableExtract and would like to use it.  However, I am 
> running into a problem.  It appears that despite my best efforts, I 
> cannot destroy a TableExtract object or clear out its TableState objects.
>
> Instead it appears that as I loop through my files the TableExtract 
> object is continually adding new TableStates.  I have tried declaring 
> the variable using
>
> my $te  = new HTML::TableExtract( depth=>0, count=>0, gridmap=>0)
>
> buried inside a loop that is inside the loop that reads the files 
> in--hoping that it would be destroyed when my code exited the loop.
>
> I have tried explicitly calling the $te->DESTROY method at the bottom 
> of my loop.  This does not generate any errors, but doesn't seem to do 
> anything.
>
> I've only played with about 100 files so far, and each time through 
> the loop, it is progressively slower.
>
> I suppose I could write code to create separate perl scripts using 
> just a few tables at a time and then call those scripts--but I'm 
> hoping I've missed something simple in the documentation.
>
> Is there an explicit way to clear the TableState objects or to destroy 
> and re-instantiate the TableExtract object?
>
>      ---Tim Rushing
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: The SF.net Donation Program.
> Do you like what SourceForge.net is doing for the Open
> Source Community?  Make a contribution, and help us add new
> features and functionality. Click here: http://sourceforge.net/donate/
> _______________________________________________
> Table-extract-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/table-extract-general




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click