IO::Handle::unread - Pushes string back into input filehandle
This document describes IO::Handle::unread version 0.02
use IO::Handle::unread; *STDIN->unread("foo\n"); print scalar <STDIN>; # => "foo\n"
This module provides IO::Handle class with unread(), a superset of stdio's ungetc().
IO::Handle
unread()
ungetc()
Since the unread() routines of some layers are unstable, do not use this module for anything serious. There is NO WARRANTY.
Pushes string back into FILEHANDLE, which is available for subsequent read operations.
This method returns the unreaded byte length.
Here is an implementation of ungetc(), which deals with one-byte string.
sub ungetc{ my($in, $char) = @_; $in->unread($char, 1) == 1 ? $char : undef; }
IO::Handle::unread requires no configuration files or environment variables.
Perl 5.8.1 or later.
No bugs have been reported.
Please report any bugs or feature requests to bug-io-handle-unread@rt.cpan.org/, or through the web interface at http://rt.cpan.org/.
bug-io-handle-unread@rt.cpan.org/
IO::Handle.
perliol.
Goro Fuji <gfuji(at)cpan.org>.
Copyright (c) 2008, Goro Fuji <gfuji(at)cpan.org>. Some rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install IO::Handle::unread, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Handle::unread
CPAN shell
perl -MCPAN -e shell install IO::Handle::unread
For more information on module installation, please visit the detailed CPAN module installation guide.