seek(FH, (0 - length($line)+tell(FH)), SEEK_CUR);
You are seeking too far back. You're seeking back the length of the string plus the byte-number of your current position...If you wish to use tell() to record the old position before your read, then you'd use: seek(FH, $old_position, SEEK_SET); instead.
-Paul
In reply to Re^4: reading a line from file two times
by jettero
in thread reading a line from file two times
by jesuashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |