Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

(kudra) Re: Reading entire file.

by kudra (Vicar)
on May 04, 2001 at 10:06 UTC ( #77881=note: print w/replies, xml ) Need Help??

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?

      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.
      (is a he)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://77881]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2021-12-04 16:31 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (30 votes). Check out past polls.