Perl's API has changed over time, gaining new features, new functions,
increasing its flexibility, and reducing the impact on the C namespace
environment (reduced pollution). The header file written by this module,
typically ppport.h, attempts to bring some of the newer Perl API
features to older versions of Perl, so that you can worry less about
keeping track of old releases, but users can still reap the benefit.
Devel::PPPort contains a single function, called WriteFile. Its
only purpose is to write the ppport.h C header file. This file
contains a series of macros and, if explicitly requested, functions that
allow XS modules to be built using older versions of Perl. Currently,
Perl versions from 5.003 to 5.9.3 are supported.
This module is used by h2xs to write the file ppport.h.
You should use ppport.h in modern code so that your code will work
with the widest range of Perl interpreters possible, without significant
additional work.
You should attempt older code to fully use ppport.h, because the
reduced pollution of newer Perl versions is an important thing. It's so
important that the old polluting ways of original Perl modules will not be
supported very far into the future, and your module will almost certainly
break! By adapting to it now, you'll gain compatibility and a sense of
having done the electronic ecology some good.
Don't direct the users of your module to download Devel::PPPort.
They are most probably no XS writers. Also, don't make ppport.h
optional. Rather, just take the most recent copy of ppport.h that
you can find (e.g. by generating it with the latest Devel::PPPort
release from CPAN), copy it into your project, adjust your project to
use it, and distribute the header along with your module.
But ppport.h is more than just a C header. It's also a Perl script
that can check your source code. It will suggest hints and portability
notes, and can even make suggestions on how to change your code. You
can run it like any other Perl program:
perl ppport.h [options] [files]
It also has embedded documentation, so you can use
WriteFile takes one optional argument. When called with one
argument, it expects to be passed a filename. When called with
no arguments, it defaults to the filename ppport.h.
The function returns a true value if the file was written successfully.
Otherwise it returns a false value.
The header file written by this module, typically ppport.h, provides
access to the following elements of the Perl API that is not available
in older Perl releases:
There is still a big part of the API not supported by ppport.h.
Either because it doesn't make sense to back-port that part of the API,
or simply because it hasn't been implemented yet. Patches welcome!
Here's a list of the currently unsupported API, and also the version of
Perl below which it is unsupported:
If you find any bugs, Devel::PPPort doesn't seem to build on your
system or any of its tests fail, please use the CPAN Request Tracker
at http://rt.cpan.org/ to create a ticket for the module.
perldoc2tree.cgi: /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Devel/PPPort.pm: cannot resolve L in paragraph 84.
perldoc2tree.cgi: /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Devel/PPPort.pm: cannot resolve L in paragraph 84.