fionbarr has asked for the wisdom of the Perl Monks concerning the following question:

I am using CAM::PDF, with getpagecontenttree and pagetext->render to read PDF files. The program often hangs for an extended period of time and then takes off again. I tried processing an offending file all by itself to see if there's any accumulated garbage collection and that's not it. Any ideas or better techniques?
my $doc = CAM::PDF->new($filename) || die "$CAM::PDF::errstr\n"; foreach my $p ( $doc->rangeToArray( 1, $doc->numPages(), $pagelist + ) ) { print "working on page $p of $filename\n"; my $tree = $doc->getPageContentTree( $p, $opts{verbose} ); my $this_page_text = CAM::PDF::PageText->render($tree); $whole_text .= $this_page_text; }