in reply to Win32::Process not waiting

It's often helpful if you can give a runnable sample of you code that exhibits the problem. The following is based on your sample and runs as expected on my system:

use strict; use warnings; use Tk; use Win32::Clipboard; use Win32::Process; $::CLIP = Win32::Clipboard(); my $ProcessObj; Win32::Process::Create($ProcessObj, 'c:\Windows\system32\notepad.exe', "notepad", 0, NORMAL_PRIORITY_CLASS, ".") || die "Can't create"; my $emptytries = 0; my $clip; while (1) { $clip = Win32::Clipboard::GetText(); if ($clip) { print "$clip\n\n"; $::CLIP->Empty(); $emptytries = 0; sleep(5); } else { $emptytries++; last if ($emptytries >= 3); print "."; sleep(1); } } $ProcessObj->Wait(INFINITE); print "Done";

Prints:

asddf ..Done

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Win32::Process not waiting
by Stephen Toney (Sexton) on Feb 15, 2007 at 21:27 UTC
    Sorry, will do so in future. It's much appreciated!

      You may like to run the sample I provided and verify that it behaves as expected on your system. If it does, alter it until it doesn't then post the result and tell us how it fails your expectations. If it does, tell us how it fails your expectations and show us the versions of modules and Perl that you are using. The less we have to guess the more we can help with your actual problem.


      DWIM is Perl's answer to Gödel