Well, to sort of answer one of your questions- after writing,
you need to go back to the begining of the file to read it.
The cursor (more or less) is left just after where you finished
writing. Set the cursor to the beginning of the file again
with a
seek(FILEHANDLE, 0, 0).
Then, after a read, you'll be ready at the end of the file
for the next write. So goes the theory...
Your unpredictable results will be closer to what you expect.
Sort of.
Probably you shouldn't be doing this, though.
-><- -><- -><- -><- -><-
All things are Perfect
To every last Flaw
And bound in accord
With Eris's Law
- HBT; The Book of Advice, 1:7