in reply to Re^4: seeking help for seek function
in thread seeking help for seek function
After you've read a line, the file pointer will naturally always be at the end of the line (= beginning of the next line). That is so because for every byte being read, the file pointer advances by one.
Try this to get the correct positions:
my @indx; my $pos = 0; while(<FH1>){ my ($id, $seq) = split /\t/; push(@indx, "$id\t$pos"); $pos = tell FH1; }
|
|---|