PerlIO::code - Calls a subroutine with I/O interface


PerlIO-code documentation Contained in the PerlIO-code distribution.

Index


Code Index:

NAME

Top

PerlIO::code - Calls a subroutine with I/O interface

VERSION

Top

This document describes PerlIO::code version 0.03

SYNOPSIS

Top

	use PerlIO::code; # need to say explicitly

	# make an input filter
	open my $in, '<', sub{ uc scalar <> };
	print while <$in>;

	# make an output filter
	open my $out, '>', sub{ print uc shift };
	print $out while <>;

	# it accepts an extra argument
	sub my_readline{
		my($fh) = @_;
		my $line = <$fh>;
		# ...filterling...
		return $line;
	}
	open my $fh, '<', \&my_readline, \*STDIN;

DESCRIPTION

Top

PerlIO::code helps to make an simple I/O filter. It is easier than tie, but provides very limited functions. All it can do is to do readline() and print().

NOTES

Top

CONFIGURATION AND ENVIRONMENT

Top

No configuration files or environment variables.

DEPENDENCIES

Top

Perl 5.8.1 or later, and a C compiler.

BUGS AND LIMITATIONS

Top

No bugs have been reported.

Please report any bugs or feature requests to bug-perlio-code@rt.cpan.org, or through the web interface at http://rt.cpan.org/.

SEE ALSO

Top

PerlIO::Util.

Tie::Handle.

PerlIO::via.

PerlIO.

AUTHOR

Top

Goro Fuji <gfuji(at)cpan.org>.

LICENCE AND COPYRIGHT

Top


PerlIO-code documentation Contained in the PerlIO-code distribution.

package PerlIO::code;

use 5.008_001;

use strict;

our $VERSION = '0.03';

use XSLoader;
XSLoader::load(__PACKAGE__, $VERSION);

1;
__END__