| Next | The Perl Hardware Store | DC.pm Version | 50 |
I promised a remember operation
$fh->remember('hippo') will save the current position under the key hippo.
sub remember {
# $self is a GLOB reference
my ($self, $key) = @_;
*$self->{$key} = tell $self;
}
$fh->gobackto('hippo') will return to the saved position.
sub gobackto {
my ($self, $key) = @_;
seek $self, *$self->{$key}, 0;
}
Future reads from the `filehandle' will continue from the old position
| Next | ![]() |
Copyright © 2003 M. J. Dominus |