in reply to preview a filehandle's next character WITHOUT changing the position of the handle

To my knowledge, the system provides no such call. At best, you can "unread" what you read by seeking back, or by playing with the buffers.

Update: Actually, linux provides pread: "Read from a file descriptor at a given offset. The file offset is not changed." I don't see any existing modules providing access to it, though. It requires a seekable handle.

  • Comment on Re: preview a filehandle's next character WITHOUT changing the position of the handle
  • Download Code

Replies are listed 'Best First'.
Re^2: preview a filehandle's next character WITHOUT changing the position of the handle
by BrowserUk (Patriarch) on Nov 09, 2011 at 20:48 UTC

    Ignore this. PM is royally screwed up at the moment.