in reply to Reading entire file.

Update: Oops, thank you cLive--I misread the $that = 0; as another $that = 1 and therefore saw it as just checking and printing single lines.

As for your problem with stopping, I'm not seeing any reason why this section wouldn't work (assuming $foo and $bar are what you want them to be)

Ps. You can print $. instead of keeping a counter.

Replies are listed 'Best First'.
Re: (kudra) Re: Reading entire file.
by stuffy (Monk) on May 04, 2001 at 10:16 UTC
    The lines will not contain both $foo and $bar at the same time. As a very newbie I do not understand exactly what your code is saying. (my programming experiance comes from pascal programming in high school 6 years ago.) Also, how does Perl know that it is at the end of a file?

    Stuffy
      See eof:
      if ( eof FILEHANDLE ) { print "Reached end of file.\n"; }


      ar0n ]

Re: Reading entire file.
by cLive ;-) (Prior) on May 04, 2001 at 10:31 UTC
    This doesn't do what (s)he wants. They're looking at grabbing a block starting with $foo and up to, but not including, $bar.

    (as far as I can see).

    cLive ;-)

      you are correct, I do not want to include $bar. I wouldn't mind if it started after (not including) $foo either.
      Stuffy
      (is a he)