#MainSub sub MainSub { $::CLIP->Empty(); print "before creating process\n"; my $ProcessObj; Win32::Process::Create($ProcessObj, "c:\\windows\\system32\\notepad.exe", "notepad", 0, NORMAL_PRIORITY_CLASS, ".") || die Win32ProcessError(); print "before wait\n"; $ProcessObj->Wait(INFINITE); print "after wait\n"; } #MainSub sub Win32ProcessError { print Win32::FormatMessage(Win32::GetLastError()); } 1;