This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

New Package Available: perl-libwin32-0.191-1


The libwin32 Perl library that provides access to the Win32 API, and is
installed by default with ActivePerl, is now available as a Cygwin package.

The CORE Win32 methods in ActivePerl such as Win32::GetLastError() (see man
Win32 or perldoc Win32) are also available as an extension.

Also included is version 0.0.670 of the actively developed Win32::GUI library,
providing access the Win32 graphical APIs.

A lot of this functionality is already available through the /proc interface
and various utilities bundled with Cygwin, but this allows greater
compatibility with CPAN modules and various scripts written for ActivePerl on


Browse through /usr/share/doc/perl-libwin32-0.191/. Examples and tests for
various modules and extra documentation is located there. Manual pages are
installed as well, eg. "man Win32API::File".

Differences from ActivePerl

* The core Win32 methods are statically linked into ActivePerl, they are NOT
when using this library.

So while:

/cygdrive/c/Perl/bin/perl -le 'print Win32::FormatMessage(5)'

works, in Cygwin you would have to do:

perl -MWin32 -le 'print Win32::FormatMessage(5)'

Generally, when porting a windows Perl script, a "use Win32;" statement will be
required. To get just the CORE method, "use Win32CORE;".

* $^E is the equivalent of Win32::FormatMessage(Win32::GetLastError()) on
ActivePerl, while it is the SAME as $! on Cygwin Perl. Therefore:

> perl -MWin32 -le 'open F,"xyzzy"; print $^E'
No such file or directory
> /cygdrive/c/Perl/bin/perl -MWin32 -le 'open F,"xyzzy"; print $^E'
The system cannot find the file specified

To get the equivalent:

> perl -MWin32 -le 'open F,"xyzzy"; print Win32::FormatMessage(
The system cannot find the file specified.

This may be fixed in the future.

* Win32API::File::OsFHandleOpen is not really implemented, since there is no
open_osfhandle() in Cygwin. At present it just ties a simple and not fully
functional interface to other Win32API::File calls to a Perl file handle. It
needs a lot more work to be transparent.

* Overlapped IO may not really work, but it hasn't really been implemented
fully in the library in the first place.

Have fun!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]