On Thu, 4 May 2000, Thomas Zapf-Schramm wrote:
> Can anybody tell me, why this script freezes after 70 iterations of the
> outer loop?
>
>
> use Win32::OLE qw(in with);
> use Win32::OLE::Const 'Microsoft Word';
>
> my $appWD=Win32::OLE->new('Word.Application', 'Quit')
> or die "Oops, cannot start Word";
> $counter=0;
> while(1) {
> {
> my $aktDoc=$appWD->Documents->Open("Test.doc")
> or die "Cannot open WordDoc\n";
> foreach my $aktPara (in $aktDoc->Paragraphs)
> {
> foreach my $aktWort (in $aktPara->Range->Words)
> {
> # do nothing}
> }
> $aktDoc->Close;
> $counter++;
> print "$counter\n";
> }
> }
>
Could it be because 70 interations consumes all your memory?
You might want to add the following after the $aktDoc->Close call:
undef $aktDoc;
**** [EMAIL PROTECTED] <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]