in reply to seeking help for seek function

seek and sysseek just move the file pointer. If you want the data that follows, you need to read it.

Replies are listed 'Best First'.
Re^2: seeking help for seek function
by pearly (Initiate) on Mar 25, 2010 at 07:17 UTC
    i used readline function below seek, like this:
    $buffer = readline( *FH1 ); print("$buffer");
    but it still doesnt give the right sequence.
      You use tell for SID834.56 when the file pointer is here:
      SID834.56 AGAAGTCGTACGATCA [*]SID164.26 AGTCGATCATTATATATTCGCTAG
      You want to use tell for SID834.56 when the file pointer is here:
      SID834.56 [*]AGAAGTCGTACGATCA SID164.26 AGTCGATCATTATATATTCGCTAG
      That's not easy to do, but it's easy and acceptable to use tell for SID834.56 when the file pointer is here:
      [*]SID834.56 AGAAGTCGTACGATCA SID164.26 AGTCGATCATTATATATTCGCTAG

      (i.e. before you read the line)

        getting the correct position by using
        my @indx; my $pos = 0; while(<FH1>){ my ($id, $seq) = split /\t/; push(@indx, "$id\t$pos"); $pos = tell FH1; }
        thanks for that !!! trying to read the correct line now...
        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?
        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?