in reply to Re: Reading Text Lines
in thread Reading Text Lines

would I be able to reach the end of the file like that?

Replies are listed 'Best First'.
Re^3: Reading Text Lines
by ruzam (Curate) on May 11, 2006 at 17:37 UTC
    As long as you save $pos after the run, and set it up again at the beginning of the next run, you'll continue to read through the file starting where you left off.

    In my example, $pos is set to 0, but in reality you would need to set it to the value it had after the last run. Setting it to 0 each time would continually read the first 100 lines over and over. You could pass it as a hidden form variable so when the user clicks 'next' they get the next 100 lines of file. You could also pass the previous $pos as a hidden form variable so the user gets the previous 100 lines of file when they click 'back'.
      I can't use a form, I have to pass the param. using a link. How could a upgrade the value of $pos?
      Ok, thanks I'm trying this.
      Actually I am trying to create a way to increment a variable to update $pos.