NAME

IO::FD::DWIM - Mixed file handle/descriptor functions

SYNOPSIS

use IO::FD::DWIM ":all";

sysopen (my $f, ">test.txt");

syswrite $f, "hello!";

DESCRIPTION

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.

API

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

AUTHOR

Ruben Westerberg, <drclaw@mac.com>

REPOSITORTY and BUGS

This module is part of the IO::FD distribution.

COPYRIGHT AND LICENSE

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.

DISCLAIMER OF WARRANTIES

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.