Developer

10 CPAN Perl modules that make life easier for Win32 programmers

This document catalogs 10 Perl modules that can come in handy the next time you're programming in Win32 Perl.

There's something about Comprehensive Perl Archive Network's (CPAN) collection of Windows-specific Perl modules that makes most everyone happy. The Windows crowd likes it because it allows them to do relatively-complex things fairly efficiently and quickly in a Microsoft development environment. And the open-source geeks like it because it allows them to crow about Perl's superior compatibility vis-a-via other operating systems. In short, everyone wins.

That's why, regardless of which side of the fence you're currently on, you have a reason to keep reading. In this document, I've attempted to catalog some Perl modules that can come in handy the next time you're programming in Win32 Perl. (See Table A) If you're a Perl programmer attempting to navigate the Windows world, you should definitely consider adding some of these to your toolkit.

Note: You can install CPAN modules directly from the Internet, by following the instructions provided at

Table A


Package Name

Description

Win32API::Registry

This module provides an interface to Win32 API calls related to the Windows registry. It allows you to read and write registry values, create and delete registry keys, query keys, and load registry "hives" from disk.

Use this module when you need to read or write to the Windows registry.

Win32::OLE

This module allows you to control Win32 applications through a Perl script using OLE (Object Linking and Embedding). An OLE object reference is associated with the target OLE class, and OLE class methods can then be accessed through Perl.

Use this module when you need to interface with an OLE-compliant application, such as Microsoft Office.

Win32::Internet

This module provides access to library functions in WININET.DLL. It is particularly useful for managing HTTP and FTP connections in Windows.

Use this module if your Perl application needs to work with Internet connections, URLs and FTP and HTTP sessions under Windows.

Win32::Process::Info

This module makes it possible to easily access process information under Windows. It provides functions to retrieve process and sub-process IDs and get detailed process information. Note that it does not allow you to kill existing processes.

Use this module when you need to retrieve or watch the current process table.

Win32::Clipboard

This module provides an elegant interface to the Windows clipboard. It allows you to read the current contents of the clipboard, write new data to it (or reset it), or "wait" until clipboard content changes.

Use this module when you need to transfer data between Windows and Perl applications using the clipboard, or to view current clipboard contents.

Win32::Service

This module provides functions to interact with the Windows service manager and start or stop Windows services.

Use this module when you need to start or stop a Windows service (for example, while installing an application).

Win32::FileOp

This module provides an API for many different Windows-specific file operations: move files to the Recycle Bin, work with Recent Documents, edit INI files, open and close dialog boxes and use the ShellExecute method to perform default file actions.

Use this module when you need to quickly perform a variety of Windows-specific actions.

Win32::Pipe

This module lets you add support for named pipes to your Win32 Perl build.

Use this module when you need to establish client-server connections between applications and Perl servr daemons on Windows.

Win32::DriveInfo

This module lets you retrieve comprehensive information on available drives, file systems, disk space usage and free drive letters on Windows.

Use this module when you need to interact with the Windows filesystem: obtain available drive letters, calculate free and used disk space, or view drive properties.

Log::Dispatch::Win32EventLog

This module provides an API to interact with the Windows event logger. It allows you to register events and applications, link them to specific log levels, and append messages to the log.

Use this module to log errors and system messages using the Windows event tracking subsystem.

Editor's Picks