IO::FD::DWIM - Mixed file handle/descriptor functions
use IO::FD::DWIM ":all"; sysopen (my $f, ">test.txt"); syswrite $f, "hello!";
Using this modules will overwrite the Perl routines of the same name. The new routines will work with either Perl file handles or integer fds via IO::FD.
If the first argument to these functions look like a reference, then they are assumed to be Perl file handles. In this case the CORE:: version of the function will be called with the same parameters.
Otherwise, they are assumed to be integer file descriptor values and the corresponding IO::FD function will be called with the same parameters.
Special variables and syntax (i.e '_' for stat and <> for readline) will not work with these functions.
The goal of this module is to allow easy switch over from file handles to file descriptors for networking code.
The following functions are imported into the current package:
socket socketpair bind listen accept connect getsockopt setsockopt getpeername getsockname sysopen sysseek pipe close recv send sysread syswrite stat lstat fcntl ioctl readline fileno
Ruben Westerberg, <drclaw@mac.com>
This module is part of the IO::FD distribution.
Copyright (C) 2022 by Ruben Westerberg
This library is free software; you can redistribute it and/or modify it under the same terms as Perl or the MIT license.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install IO::FD, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::FD
CPAN shell
perl -MCPAN -e shell install IO::FD
For more information on module installation, please visit the detailed CPAN module installation guide.