in reply to Segment Fault(Core Dump)

I havn't run your code, but from my experiences with Tk programs I'll hazard a guess.

You are creating a new $ua ,$tree, and $formatter object for each cycle thru the loop, so maybe you are running out of memory? Have you monitored the memory usage as it runs? Is there a way for you to create the $ua ,$tree, and $formatter only once before you start the loop, then reuse them as you loop thru the data?

Maybe try undef the objects at the end of the loop, as a start.


I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re: Re: Segment Fault(Core Dump)
by Fletch (Bishop) on May 17, 2004 at 14:33 UTC

    Actually since he's reassigning to the same $tree et al each time through it the old ones (if any) should be getting deallocated. Problem is that HTML::TreeBuilder objects contain circular references and don't get garbage collected correctly. This is why the perldocs show that you're supposed to call $tree->delete when you're done with it.

      Thanks everyone for replying. I'll try using "undef" and $tree->delete at the end of the main loop to clear the garbage up. Im suprised I didn't think of this sooner Cheers! Annonymous Monk
Re: Re: Segment Fault(Core Dump)
by rinceWind (Monsignor) on May 17, 2004 at 14:28 UTC
    Don't think this is a Tk program; I see no Tk modules here.

    Any chance the OP could get dbx to produce a stack trace from the original core dump. This would help identify where the problem is.

    --
    I'm Not Just Another Perl Hacker