i just noticed that. i want to use file pointer at the begining of everyline.but, when i use tell function, why does it point to the end of the line and not the begining?
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;
}