Fcntl::Packer - Build packed structures for passing into fcntl.
use Fcntl::Packer; my $p = pack_fcntl_flock { type => F_WRLCK, whence => SEEK_SET, start => 1024, len => 512 }; fcntl($fh, F_SETLK, $p); my $out = pack_fcntl_flock {}; fcntl($fh, $_GETLK, $out); print Dumper unpack_fcntl_flock($out);
POSIX fcntl(2) function accepts some structures that may be difficult to build from Perl in a portable way (for instance, struct flock).
struct flock
This module implements pairs of methods to pack/unpack these structures.
The following subroutines can be exported from this module:
fcntl(2), "fcntl" in perlfunc, Fcntl.
There are several modules on CPAN providing high level wrappers for the functionality available through fcntl(2). I.e, IPC::SRLock::Fcntl or File::FcntlLock.
Salvador Fandiño, <sfandino@yahoo.com>
Copyright (C) 2013 by Qindel Formación y Servicios S.L.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
To install Fcntl::Packer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fcntl::Packer
CPAN shell
perl -MCPAN -e shell install Fcntl::Packer
For more information on module installation, please visit the detailed CPAN module installation guide.