NAME
Fstream - a class to encapsulate a filehandle as a stream;
SYNOPSIS
use Fstream;
DESCRIPTION
Fstream wraps a filehandle and provides methods that make it easier to write a lexer. Why doesn't Perl have ungetc?
Class Methods
- new($filehandle, $name) Creates an Fstream object from $filehandle (a filehandle glob reference). $name is a string which is stored for debugging purposes and may be accessed with &name.
Object Methods
- getc Returns the next character in the stream, or the empty string if the stream has been exhausted.
- ungetc Pushes the last character read back onto the stream, where it will be returned on the next call to getc. You may only push one character back on the stream.
- lineno Returns the line-number of the stream (based on the number of newlines seen).
- name Returns the name that was given in the constructor.