This module provides access to extended
Win32 process creation and management abilities. Process objects are
created with the Create method (the constructor).
Additional methods can be used on objects to kill, suspend, resume,
and set the priorities of processes.
The Create constructor has the following syntax:
Win32::Process->Create($Proc, app, cmnd, hndls, opts, dir)
The arguments to Create are as follows:
Name of the reference for the created process object.
Full pathname of the executable.
Command line for executable.
Determines handle inheritance. A value of 1 turns
on inheritance; a 0 value turns it off.
Sets options to implement when the process is created. The available
options for this argument are listed below.
The working directory for the executable.
The process is created by passing the command line in
cmnd to the executable named in
app. For example, a process object for a
text file running in Notepad is created like this:
"Notepad perlnut.txt", 1,
The process creation options given by the
opts argument to Create
Gives the process the default error mode.
Creates a new console for the process. Can't be used
Creates a new process, but without running the process in a new and
visible window. That is, a new process will be created, but in the
Creates process as root of a new process group.
Runs process in its own Virtual DOS Machine (VDM). Only applicable to
Starts process in a suspended state. The process can be started with
the Resume method.
Uses Unicode characters in the environment block of the new process.
Debugs the new process with the calling process.
Doesn't debug the new process if calling process is
Creates a process with no access to the console of the calling
22.14.1. Win32::Process Methods
The following methods are provided for objects of created by
Gets the exit code of a
process and saves it to
Gets the priority class of
the process and stores it in
Kills the process with the
given exitcode, which is returned by the
Resumes a suspended process.
This method can also be used on processes created with the
Sets the priority class of
the object to
$priority. The priority
can be one of the following:
A process whith threads that run only when the system is idle
A process with normal scheduling
A process that performs time-critical tasks that must be executed
The highest-priority process, even preempts operating-system threads
Suspends the process.
n milliseconds for the process to exit. If
the process times out, the method returns false and sets
$! to WAIT_FAILED. For no
timeout, sets n to
Copyright © 2002 O'Reilly & Associates. All rights reserved.