in reply to how to reset the input operater in while loop?

You mean, you want to seek back to the beginning of the file? Assuming the file is seekable (if it's not, you cannot do what you want), you'd use the function seek to seek back to the beginning. perldoc -f seek will give you the details.

Replies are listed 'Best First'.
Re^2: how to reset the input operater in while loop?
by AnomalousMonk (Archbishop) on Sep 30, 2008 at 07:51 UTC
Re^2: how to reset the input operater in while loop?
by JadeNB (Chaplain) on Sep 30, 2008 at 18:51 UTC
    Assuming the file is seekable (if it's not, you cannot do what you want) …
    Why wouldn't GrandFather's approach of close-ing and re-opening work even if the filehandle is non-seekable?

    UPDATE: Thanks to JavaFan for a very polite answer to a very silly question.

      Because non-seekable usually means the data can only be read only once. Examples of non-seekable handles are (named) pipes, STDIN (usually) and network sockets.