FileHandle::Unget - A FileHandle which supports ungetting of multiple bytes

FileHandle::Unget is a drop-in replacement for FileHandle which allows more
than one byte to be placed back on the input. It supports an ungetc(ORD) which
can be called more than once in a row, and an ungets(SCALAR) which places a
string of bytes back on the input.


To use this module, you will need to install:

- Scalar::Util

To test this module, you will need to install:

- Test::More
- File::Spec


To install this package, change to the directory where you unarchived this
distribution and type the following:

  perl Makefile.PL
  make test
  make install

You can install this package into a non-default location by appending one of
the following to the "perl Makefile.PL" command:

- "PREFIX=/installation/path" (for installation into a custom location),
- "INSTALLDIRS=site" (for installation into site-specific Perl directories)
- "INSTALLDIRS=perl" (for installation into standard Perl directories).

If you make the installation into your own directory, then remember that you
must tell perl where to search for modules before trying to 'use' them. For

  use lib '/home/userid/lib';
  use FileHandle::Unget;

If make test fails, please see the INSTALLATION PROBLEMS section below.


If you get warnings about weak references not being implemented in your
version of Perl, try upgrading your installation of Scalar::Util.

If "make test" fails, run

  make test TEST_VERBOSE=1

and see which test(s) are failing. Please email the results to the address
below, or submit a bug report on the project website as described in the
section REPORTING BUGS below.

For other bugs, see the section REPORTING BUGS below.


On Windows, this module will use a temporary file to decompress a file handle
when necessary. This could pose a security risk.


Just "perldoc FileHandle::Unget". After installation on Unix systems,
you can also do "man FileHandle::Unget".


The CPAN Page:

The GitHub page:

Bug and feature tracking:


Copyright (c) 1998-Sep 1 2000 Broc Seib. Copyright (c) Sep 1 2000-2015 David
Coppit. All rights reserved, save those granted by the license. See the file
LICENSE for licensing terms.


David Coppit <>