| Next | Tricks of the Wizards | 35 |
The constructor is similar to the previous example:
package IO::Remembers;
sub new {
my ($package, $filename) = @_;
open my $fh, $filename or return;
bless $fh => $package;
}
Once again it can be used like a regular filehandle:
my $fh = IO::Remembers->new('input');
my $line = <$fh>;
read $fh, $bytes, 1024;
close $fh;
| Next | ![]() |
Copyright © 2003 M. J. Dominus |