Sys::Headers - Perl interface to system headers.
# Update your header repository use Sys::Headers; Sys::Headers::convert_headers( includedirs => [ qw[ /usr/include /usr/local/include /usr/local/apache/include ] ], headers => [ qw[ /home/cwest/include/cwest.h ] ], ); # Use headers in your program use Sys::Headers qw[paths sys/fcntl]; my $null = _PATH_DEVNULL; my $tmp = _PATH_TMP; open( FILE, "$tmp/file" ) || die $!; open( NULL, $null, ) || die $!; flock FILE, O_SHLOCK; flock NULL, O_EXLOCK; print NULL $_ while <FILE>; close NULL; close FILE;
This is alpha code.
This module will use h2ph to convert your systems header files into Perl header files. It should be stated that h2ph isn't very good at this, it has some bugs. However, if you can handle a few warnings every now and again, and you need access to information contained in the header files, use this module.
First you need to build a repository of Perl header files. This requires having write access to the place where Sys::Headers is installed. This limitation will most likley change.
Once you've done that, you can use these headers at compile time by listing the ones you want in similar fashion to #include from C.
#include
It will export constants based on which header files you choose to use.
Casey West, <casey@geeknest.com<gt>
Copyright (c) 2002 Casey West. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl.
To install Sys::Headers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sys::Headers
CPAN shell
perl -MCPAN -e shell install Sys::Headers
For more information on module installation, please visit the detailed CPAN module installation guide.