Win32::Console

Win32::Console implements the Win32 console and character mode functions. They give you full control on the console input and output, including: support of off-screen console buffers (e.g., multiple screen pages); reading and writing of characters, attributes, and whole portions of the screen; and complete processing of keyboard and mouse events.

The new constructor is used to create a console object. It can take two forms:

$con = Win32::Console->new(standard_handle); 
$con = Win32::Console->new(accessmode, sharemode);

The first form creates a handle to a standard channel. standard_handle can be one of STD_OUTPUT_HANDLE, STD_ERROR_HANDLE, or STD_INPUT_HANDLE.

The second form creates a console screen buffer in memory, which you can access for reading and writing as a normal console, and then redirect on the standard output (the screen) with Display. In this case, you can specify accessmode to be GENERIC_READ, GENERIC_WRITE, or both, determining the permissions you will have on the created buffer.

sharemode affects the way the console can be shared. It can be specified either as FILE_SHARE_READ, FILE_SHARE_WRITE, or both. If you don’t specify any of those parameters, all four flags will be used.

Methods supported by the Win32::Console module are:

Reference Section

Reference Section

Reference Section

Reference Section

Reference Section

Reference Section

Reference Section

Reference Section

Reference Section

Reference Section

Reference Section

Reference Section

Reference Section

Reference ...

Get Perl in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.