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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32::Process not waiting
by Stephen Toney (Sexton) on Feb 15, 2007 at 21:27 UTC | |
by GrandFather (Saint) on Feb 15, 2007 at 21:56 UTC |