
package PeekHandle;

sub new {
  my $class = shift;
  my $filename = shift;
  my $fh = \do{local *FH};
  open $fh, $filename or return;
  bless $fh => $class;
}

sub peek {
  my $self = shift;
  my $pos = tell $self;
  my $nextline = <$self>;
#  print "Peeker on $self sees ($nextline)\n";
  seek $self, $pos, 0;
  $nextline;
}

1;

