constant STILL_ALIVE
am 06.06.2006 21:09:27 von evesun
I intend to use Win32::getExitCode to check if a process is alive. The
5.8 doc says the STILL_ALIVE constant need to be explicitly exported,
but my Process.pm file in site/lib/Win32 has not shown such constant.
Does anyone know how to use that constant?
Thanks!
Re: constant STILL_ALIVE
am 06.06.2006 22:25:08 von John Bokma
evesun@gmail.com wrote:
> I intend to use Win32::getExitCode to check if a process is alive. The
> 5.8 doc says the STILL_ALIVE constant need to be explicitly exported,
> but my Process.pm file in site/lib/Win32 has not shown such constant.
> Does anyone know how to use that constant?
> Thanks!
use Win32::getExitCode 'STILL_ALIVE';
maybe?
--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/
Re: constant STILL_ALIVE
am 07.06.2006 02:44:45 von Sisyphus
wrote in message
news:1149620967.579144.193180@i40g2000cwc.googlegroups.com.. .
> I intend to use Win32::getExitCode to check if a process is alive. The
> 5.8 doc says the STILL_ALIVE constant need to be explicitly exported,
> but my Process.pm file in site/lib/Win32 has not shown such constant.
> Does anyone know how to use that constant?
> Thanks!
>
E:\pscrpt>type try.pl
use warnings;
use Win32::Process (STILL_ACTIVE);
print STILL_ACTIVE, "\n";
E:\pscrpt>perl try.pl
259
E:\pscrpt>
It's a windows constant that gets picked up by the "compiled" part of
Win32::Process (ie the XS code) rather than by the perl code that you find
in Process.pm.
You need version 0.10 (or later) of Win32::Process to use it:
perl -MWin32::Process -e "print $Win32::Process::VERSION"
libwin32-0.26 contains Win32::Process-0.10. I think earlier libwin32
versions (0.24, certainly) contain Win32::Process-0.09.
The above script simply demonstrates that the constant exists and that it
has a numeric value of 259 (for me, at least).
Cheers,
Rob