in reply to Clarification on the write read mode of filehandling

A file only has one "position", which is used for reading and writing. If you write to a file, the position advances. If you try to read from the end of a file, you will get nothing. See seek for how to manipulate the read/write position, and tell to find out the current position.

  • Comment on Re: Clarification on the write read mode of filehandling

Replies are listed 'Best First'.
Re^2: Clarification on the write read mode of filehandling
by I_love_perl (Novice) on Oct 20, 2013 at 03:42 UTC

    Hi Corion,

    Thanks a lot. Yes, it was happening because the filehandle was advancing as we write and hence any read operation on the file handle was returning a blank value. I moved the filehandle back to the previous line using seek and now it is working perfectly fine.